Refactored some code into an ensureBuild function
Added getSourceUnitsWithFile function