Updated to work with TS v3

This probably still needs some tweaks (especially the documentation), but the code works and the specs run. I couldn't figure out how to run the features, though.