Ts backbone update

I didn't squash the commits yet for easier reviewing.

The old compiled JS file was out of sync with the TypeScript source and contained an old bug from the Backbone implementation. Apart from that, this fixed #447 and extracts the key code.