Unique filenames

Refactor of the crummy way file naming was being done. Enforces uniqueness in database, adds a timestamp to the end of all filenames, and truncate long filenames.

All tests pass.