Optimization of getMethodAST. Works best when the AST for lots of
methods are needed.