Options for specifying the encode and decode functions
Added variables for encode/decode options to avoid mutating the base object.
Added encoding tests
Merge pull request #14 from Cauldrath/encodeOpt

Options for specifying the encode and decode functions