added class interface for encode/decode
Merge branch 'classy'