Massive refactoring of Encoder, Trie, light changes to IOHandler
Massive refactoring to Encoder, Trie, light changes to IOHandler

Added maxnumbits to encoder