generate subcommand and migration implementation

This adds a generate subcommand and implements generating migrations.

Closes #6.