Some database init code, which doesn't work even though it's straight from the tutorial, and some cleanup.