Move compile from src/node/api.js into src/Compiler

Fixes #1002
Improve temp variable handling for destructuring transformer

This fixes an issue where we added the temp variable outside the
function body when transforming destructuring for formal
parameters.

Fixes #1063