The `Encoding` class refactoring

Hi there! I've made it a little bit more OOP.