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.