Fixing file upload

The main problem was that we were checking the file size and content type from Flask's FileStorage object, and these come from the client. Phantom doesn't set these so the tests were failing. This branch fixes this by calculating file size and content type ourselves.

There were also multiple broken tests that were probably just out of date or perhaps had never really worked properly. These have all been fixed.