Refactored UploadController to be testable.
Updated tests for UploadController.