A cleaned-up and squashed version of shapeless derived codecs.

This is all the work of @maxpow4h and @travisbrown, see #108.

Fixes #108.
Fixes #109.

This still has some issues around how the types are
encoded and sum types, but it puts things in an
easier state for someone else to help with.