Moved data partition function to new class:

This will be useful in the future when new Data{En,De}coder subclasses
are added.