Allow keys to be munged when encoding

Basically the opposite of #27.