added function type declarations and type checking.
also put all compiler code in a namespace.