rename compile to transpile; better error handling; other minor improvements