simplifying error template rendering
fixing uploaded_file.py so that it no longer uses the browser's content type and content length

It is generally a bad idea to trust the client for this sort of thing, and this isn't just a theory - phantom was giving empty values for these fields, thus causing our tests to break
re-adding error logging on upload error

It was removed by mistake, so I'm re-adding it
changing UploadedFile to use mimetypes.guess_type() instead of magic.from_buffer

mimetypes.guess_type is better than magic at figuring out mimetypes
adding required steps to behave tests

The steps are required in order for the tests to pass
PEP8 changes
fixing bug - MAX_FILE_SIZE is exclusive

This fixes an off-by-one error
fix and re-include file upload tests

It is important that we test this functionality