Add error handling to function assertions
Refactor towards a compiler with only two languages