ES6 shim

Smallish cleanup and added tests for es6 shim functionality.