Better modularization of encoder and decoder.
Moved some functions to the header.
Used some boost features. Decoupled modules to be able to test the en- and decoder.