Cleaned up code, added more to upload function

Upload integration to Facebook to come