Fix upload json

upload previously expected the json to contain
a toplevel "object":{...} which is rather inconsistent
with the rest of the api.
Move it into the actual upload function in private.
Implement include query parameter.
Improve uploading, add test.

Now we automatically associate an
upload with the object that was passed in.

Test the whole thing.
Merge pull request #29 from gladhorn/dev

File upload improved