update to latest typescript

also changed type of dispatch and Signal()
Signal() now takes a StateTree instead of dispatch
add typescript compilation command
update window and DEBUG variables