TVB-2781: Refactored a little the way we check for datatype references
Created by: VinczeRobert
Before we closed the previous PR for this task I was concentrated on getting this right for project imports but the changes affected the testing for singular files. Now both scenarios work fine.