Move to PostgreSQL and make some minor cleanups of existing DB stuff
Fix compatibility issues with key/value store stuff