Added version to model to prepare for migrations.

Also fixed some tests.