Analyzer phase refactorings

Two commits which cleanup Analyzer phase by moving some of the logic into separate files.