Added database setup code.

Haven't actually run said code yet, because there's 44 thousand or so pages of reviews on BA, but it works.