SQLite DB versioning and migration

This adds a framework for versioning the SQLite db and for handling migrations.

Additionally, it adds two migrations.

0 → 1: Just add a version number
1 → 2: Add the `attempts INTEGER DEFAULT 0` column to support the upcoming POST attempts limiting.

I added them both at the same time because having N > 1 migrations in place makes it easier to understand how future migrations would be added.

I'd like to add a test, but haven't given that enough thought to have a concrete proposal. I'm submitting this now for quick feedback before going too deep on all of this.

@terryhorner (and any others), could you look through and provide feedback on this strategy and implementation?