Moved database methods out of the ModuleRepository and into its own DatabaseRepository. Updated references. Also did some more work on the ERF exporter.