Move database out to shared code.