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.
Note that this failed because the real http logic (as opposed to when we were
faking it with httptest.ResponseRecorder) does not send back the body
when doing a HEAD request. Given that there's no actual logic
in the code that is HEAD specific, it seems reasonable to drop the this case.
An alternative would be to refactor the test to make the handler
store the id in a local variable.