Commands: Discover context types from migrations

Resolves #628