Options for specifying the encode and decode functions

This will allow a user to specify the encode and decode functions without affecting the default behavior if nothing is specified.  For example, using a function that just returns its input will allow cookies to be generated which aren't encoded.