Complete restructure into a module.
Cleaning up the repo.
Fixed path problem.  Database only stores basenames and reconstructs the path to the upload later.
I had to tweak a few things for the histogramming to work properly and did little housekeeping.  I removed some unecessary imports.