Sketch out a base object for databases.

As an initial step try to factor out the decrypt
and encrypt methods.
Merge branch 'master' into db-refactor
Database design improvements

The database module is now split into a base class with common methods
and properties and a File class that make use of it. This cleans up
File, and paves the way for other storage options.