Refactored to fix the threading issues with the two databases, and allow
the database to load outside the startup thread for tomcat.