Breaking down the upload_directory() method.

It was getting to big so I am breaking it down.
Now it simply uploads the files in a directory to the server and also sets up the data_dict.