Cleanups and preparations

* Improved function-related AST nodes
* Added some support for "global class"
* Added some support for implicit local function