[BUGFIX beta] Fix various issues related to ES6 import correctness.

* Remove duplicate imports.
* Ensure that modules do not declare variables with names matching local imports.

These things are currently allowed by the es6-module-transpiler but not by the ES6 spec.