Change vid encoding so that we only encode to base 64 on serialization.

This made some existing logic feel more difficult than it should,
so added enum encoding and encode and decode methods
to make it easier to make encoding transformations.

Added a couple of TODOs - one as a reminder that json deserialisation
is incomplete, the other because I did not understand the code.

Also changed a couple of asserts to runtime checks (more
are needed).
Merge remote-tracking branch 'rogpeppe/001-change-vid-encoding'

* rogpeppe/001-change-vid-encoding:
  Change vid encoding so that we only encode to base 64 on serialization.
Cleanup warnings from merge commit
Convert `u_char` instances to `unsigned char` to improve portability

`u_char` is not in the C standard, and so this fails to build on OSX.
It could be fixed by including `sys/types.h`, but it seems easier just
to write it out as `unsigned char` instead of pulling in yet another
header file.
Merge branch 'u_char_removal' of https://github.com/avsm/libmacaroons

* 'u_char_removal' of https://github.com/avsm/libmacaroons:
  Convert `u_char` instances to `unsigned char` to improve portability
Merge branch 'master' of github.com:rescrv/libmacaroons

* 'master' of github.com:rescrv/libmacaroons:
  Convert `u_char` instances to `unsigned char` to improve portability
  Cleanup warnings from merge commit
  Change vid encoding so that we only encode to base 64 on serialization.