Db migrations

Implement a general mechanism for database migrations and change the script oq_create_db to use it.
See https://bugs.launchpad.net/oq-engine/+bug/1294566. The tests are green: https://ci.openquake.org/job/zdevel_oq-engine/568