Ast upgrade

Upgrade the compiler ast facilities. These updates should be 100% transparent to the user, but will allow more flexible language constructs (like templates) going forward.