Add database abstraction and initialization code.
Change configuration to use flags and the iniflag package for configuration files.