Allow extend to work with non-prototyped objects

ES6 modules do not extend the Object prototype so this blows up under the latest version of the transpiler.
Export AST as an object rather than module

The parser expects the AST object to be mutable, which modules are not.
Add missing semicolon