Compact serialization of AST term trees