Refactors MethodCompiler::scanForBranches() using basic block visitor

Issue: #32