Revert "Merge pull request #91 from mkly/database_singleton_fixes"

This reverts commit d54b7a1b4d38c620124b0570198d9e07985d447f, reversing
changes made to aea3148c1242788a444d6ad6019a89ecbbc55a1d.