amberc.js: move loose functions into AmberC object

Now the compiler can be created and run with the
following lines:

  var amberc = new AmberC();
  amberc.main();