Refactor uploader so that is more easily testable. Add uploader tests.
Use joda time instead of manual calculations. Add misc tests.