Added encode/decode options

This is a proposal.

I've added a feature custom encode/decode options. This enables other format handling (e.g.. Messagepack).