Big restructuring, allowing us to check /exists before uploading

Fixes #5
Minor quoting fixes