Implementing Marshaler and Unmarshaler interfaces for Macaroon and Caveat.

// macaroonJSON defines the JSON format for macaroons.

and move the definition to just before the caveatJSON type definition, please.