Rewrite to typescript
Rewrite tests to work
Make tests runnable via grunt-mocha