Moved ast-manipulating functions from inlines to ast.