Add database versioning

Implementing database versioning: add table to log changes, scripts to
manage database updates.