Improved TisDecoder

- more flexible and extensible design
- requires less memory