Upload tests

Here are some tests for the S3 module.  Production code hasn't changed, but TDD'd it back in.

I think the S3 stuff needs the same open-closed refactor as that happened to the database.
This end-of-line character, that's the only change I made to the code I was testing.