Sem: Move class to top-level; allow running given function on AST nodes for testability