internal/v4: implement archive uploading

We don't yet verify bundles against charms in the store.

This required some refactoring of the testing code;
the most important change is AssertJSONCall actually
makes a real HTTP call through a socket, as that
allows us to correctly test the ContentLength logic.
It also gives us greater assurance that the logic
will work over a real HTTP connection. The overhead
seems to be negligible.
You should not have needed to go deep into the bundledata code to
understand that - it's part of the documented contract of the function.
Perhaps the wording of that should be improved (I thought that
"The verifyConstraints function is called to verify any constraints
that are found." was fairly self-evident, but I guess not).

I agree with frankban's suggestion regardless, so I've done that.