Some minor changes

Hi,

I've started making some (mostly quite minor) changes to your code, which I find a good start. It's quite useful to be able to serve out .ts files automagically; my changes just add some useful pieces. Feel free to select which parts you like and ask me if you have questions.