[major] migration to postgres, bye bye mongodb

This commit is a giant refactoring of the data model of MIG. Moving from
mongo to postgres introduced a number of constraints in order to fit action,
commands, agents and investigators into a relational database. The result is
a much cleaner, much easier to query, database backend that will let us
create reports much more easily.

Plus, postgresql json support is awesome!
[minor] generator cleanup