Added basic function definition and function call support

- Also fixed a bug with variable declarations for inner scopes being hoisted to the outer one