Move AST comparison to separate library