Typescript port

The typescript port I mentioned the other day - now with a Gruntfile.
I think a standard JavaScript object, and a separate `each`/`forEach` function, would be far more primitive. ;-)