added ClassEncoder and ClassDecoder to replace Classer (ported from Colibri, Python 3 only)