Custom encoder

#34

I'm not sure about this approach, however it works and not influence on public API. Let me know what you think.
Shouldn't we put this after the the next function clause? Do you thing It might happen that someone wants to apply a encoder to a binary value?