Bug 947018: Delete large amounts of database migration code. r=wesj

Now with test code included.