Expose LoaderHook functions on Loader class

Normalize, locate, and fetch tested.

Review URL: https://api.github.com/repos/google/traceur-compiler/issues/796

Closes #796.
Rename code generation starget function ModuleStore.registerModule -> Sy...

...stem.register()

Review URL: https://api.github.com/repos/google/traceur-compiler/issues/797

Closes #797.
Use baseURL through out System; set to absolute path.

Remove rootURL, thread baseURL through Loader code.
On node, replace ./ by absolute path so error messages make sense.

Review URL: https://api.github.com/repos/google/traceur-compiler/issues/800

Closes #800.
Type assertion update

This is a big commit that contains three changes described below.

Originally it was three different commits as it should be, but during the code review I significantly changed the whole thing and so it would take me a lot of time to split it back into coherent commits, as all the changes depend on each other.

1/ assert all arguments with assert.argumentTypes()

```js
function request(url: String, callback: Function) {}

// before:
function request(url, callback) {
  assert.type(url, String);
  assert.type(callback, Function);
}

// after:
function request(url, callback) {
  assert.argumentTypes(
    url, String,
    callback, Function
  );
}
```

Instead of asserting each argument on its own, we assert all of them. That has benefits:
- we can show all errors (instead of throwing on first incorrect argument),
- we can show incorrect arg position.

2/ assert function return value with assert.returnType()

```js
function reverse(str): String {}

// before
function reverse(str) {
  return assert.type(str, String);
}

// after
function revers(str) {
  return assert.returnType(str, String);
}
```

There are some advantages of this approach:
- the assert library can show different error for return value (eg. "Function has to return x"),
- the assert.returnType() has to return the actual value, but assert.type() does not have to.

3/ replace value types with assert.x

```js
function foo(a: string, b: number, c: boolean, d) {}

// transpiles into
function foo(a, b, c) {
  assert.argumentTypes(
    a, $traceurRuntime.type.string,
    b, $traceurRuntime.type.number,
    c, $traceurRuntime.type.boolean,
    d, $traceurRuntime.type.any
  );
}
```

Review URL: https://api.github.com/repos/google/traceur-compiler/issues/791

Closes #791.
Implement TraceurLoader.version to identify traceur as System.version

Review URL: https://api.github.com/repos/google/traceur-compiler/issues/801

Closes #801.
Add test for promise.catch(); refactor Loader tests to use catch().

Review URL: https://api.github.com/repos/google/traceur-compiler/issues/788

Closes #788.
Ensure that codeUnits have non-empyt .url for source-maps.

The source-map code won't take null.
Centralize the name-invention for possible future improvement.
Name anonymous sources with serial numbers.

Review URL: https://api.github.com/repos/google/traceur-compiler/issues/803

Closes #803.
Update to use node 0.10

Review URL: https://api.github.com/repos/google/traceur-compiler/issues/809

Closes #809.
Remove unstarred generator

Review URL: https://api.github.com/repos/google/traceur-compiler/issues/804

Closes #804.
Fix issue related to parsing yield

yield should be treated as an identifier in non generator function in non strict mode.

Also handle no lineterminator here between yield and *.

Review URL: https://api.github.com/repos/google/traceur-compiler/issues/806

Closes #806.
Fixup AnonSourceMap test

Review URL: https://api.github.com/repos/google/traceur-compiler/issues/808

Closes #808.
Fix issue with for loops in generators

The old code generated an invalid state machine for certain combinations of for loops with empty headers. This fixes the code and tries to clean it up so that there are less branches that were spread out all over the function, making it hard to reason about.

We had tests for all the combinations before but the test didn't call next enough times to actually verify that the behavior was correct. This expands on the tests to make sure we actually run the generator a few times.

Fixes #802, #331

Review URL: https://api.github.com/repos/google/traceur-compiler/issues/810

Closes #810, closes #802.
Move code down into the CPS generator transformer

This moves the special case handling of `yield *` and `expr = yield` into GeneratorTransformer (which is the generator specific CPS transformer) instead of doing it in a preprocessing transformer.

The motivation for this is to eventually support more yield expression and not all yield expressions can be done in a preprocesser.

Review URL: https://api.github.com/repos/google/traceur-compiler/issues/815

Closes #815.
AMD and ES6 interop support

Under modules=amd, mark modules with property '__esModule', and treat all other modules as default exports to allow mixing ES6 and AMD modules under both ES6 and AMD loaders.

Review URL: https://api.github.com/repos/google/traceur-compiler/issues/785

Closes #785.
Followup cleanup from last commit
Print a stack trace when the interpreter sees an exception.

Set the process.exit code to 8 on error
Fixes #812

Reviewed on #814.

Review URL: https://api.github.com/repos/google/traceur-compiler/issues/823

Closes #823, closes #812.
Simplify the ErrorReporter to not support rest params

The usage of rest params is less useful now that we have full support for template literals.

Review URL: https://github.com/google/traceur-compiler/pull/821

Closes #821
CPS transformer: Extract the variable hoisting

Move the variable hoisting out of CPSTransformer into its own transformer. Then let the CPSTransformer hook into that for its machine generated variables.

Review URL: https://api.github.com/repos/google/traceur-compiler/issues/817

Closes #817.
only include __moduleName if set

Currently modules with no name are having `__moduleName = (void 0);` written in.

This removes that.

It is useful because a dynamic loader can then set this `__moduleName` variable in an outer scope when evaluating the module to give it a name when loaded.

Review URL: https://api.github.com/repos/google/traceur-compiler/issues/825

Closes #825.
Update third_party/codemirror2 to codemirror-3.22

Review URL: https://api.github.com/repos/google/traceur-compiler/issues/805

Closes #805.