TS Vector class refinement

Also some more detailed cleanup to EventDispatcher to avoid unnecessary
memory allocation.