Restrict javascript variable/function definitions to top level
Make sure expressions following a 'return' are still compiled to catch errors