Rearranging some model dependencies

Changes affect both database (migrations) and model specifications.

Also, some project layout and toolchain related changes, esp. to .gitignore.