New extension mechanism, part 1: make AST compiler fully monadic