Ported code to support Typescript 1.0

- Added generic support
- Improved design of transitions
- Refactored TimedValue to use a TreeMap instead of an array as the data
structure to store transitions