Functions

Translation of functions from AST to SAST is now working.  
It's also used in `gen_semantic_program` and I think it might be useful for adding variables to class scope and such.