Limit maximum upload size.
Refactor uploader and improve logging.