encoding: Move the functions into the encoding class

Add some TODO to this class. E.g. they could all work on the
bitvec and the parameter handling could better.
7 files changed