Add ability to override cookie encoding and decoding.

This allows for being able to change the way the cookie value is decoded
or encoded for arbitrary use-cases.

The function should take a single argument which is a map where the key
is the name of the cookie and the value is the value of the cookie. This
function is expected to return a string.