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.
I'm not sure it matters that much. Everything in Store is internal to the charmstore repo
anyway. UploadCharm is useful for tests outside of the internal charmstore package,
where we don't necessarily have an API available. We could lose the "for tests only"
comment if you like - it's actually a perfectly valid method, but just one that we
don't happen to need in production code.