013 marshalbinary

Fix bugs in binary marshal/unmarshal code and tests.
We will also need add a test that we can work with binary serialization produced by libmacaroons, I think.

Here's a binary serialisation produced by libmacaroons (actually from my updated
version, which should merge soonish):

MDAxN2xvY2F0aW9uIHNvbWV3aGVyZQowMDEyaWRlbnRpZmllciBpZAowMDEzY2lkIGlkZW50aWZpZXIKMDA1MXZpZCAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAC4i9QwCgbL/wZGFvLQpsyhLOv0v6VjIo2KJv5miz+7krqCpt5EhmrL8pYO9xrhT80KMDAxM2NsIHRoaXJkIHBhcnR5CjAwMmZzaWduYXR1cmUg3BXkIDX0giAPPrgkDLbiMGYy/zsC2qPb4jU4G/dohkAK

here's the JSON equivalent of it:

{"caveats":[{"cid":"identifier","vid":"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAuIvUMAoGy\/8GRhby0KbMoSzr9L+lYyKNiib+Zos\/u5K6gqbeRIZqy\/KWDvca4U\/N","cl":"third party"}],"location":"somewhere","identifier":"id","signature":"dc15e42035f482200f3eb8240cb6e2306632ff3b02daa3dbe235381bf7688640"}

The test should check that we can deserialise the former, and, when serialised with JSON, it should match the latter.