Added typescript support to compilation + tests

should allow working with (or without) typescript, and using typescripts tests.