Refactor, fixing tests, misc. bugs. #822

15 jobs for 822-example-uploads in 7 seconds (queued for 5 seconds)