I wanted to import data to do some family-related planning (like date
ideas with my wife), but there was a very annoying bug in import,
that was probably related to earlier refactoring where there are
now more controller classes, which means they create multiple mDB
connections, and those connections were causing problems during import
like the below.  This is work in progress, not yet well reviewed or
tested, but allows reproducing the bug in case there's opportunity
later to come back to this point & add tests around it etc.

So, the bug is still here; this is some refactoring etc that help to
find and understand it while stepping through code.  The error
message had during import is:
Exception while processing sql: insert into EntitiesInAGroup (group_id, entity_id, sorting_index) values (-9223372036854775807,-9223372036854742943,-9223372036854775808)
org.onemodel.OmDatabaseException: Exception while processing sql: insert into EntitiesInAGroup (group_id, entity_id, sorting_index) values (-9223372036854775807,-9223372036854742943,-9223372036854775808)
	at org.onemodel.database.PostgreSQLDatabase$.dbAction(PostgreSQLDatabase.scala:149)
	at org.onemodel.database.PostgreSQLDatabase.dbAction(PostgreSQLDatabase.scala:214)
	at org.onemodel.database.PostgreSQLDatabase.addEntityToGroup(PostgreSQLDatabase.scala:1020)
	at org.onemodel.ImportExport.createAndAddEntityToGroup(ImportExport.scala:240)
	at org.onemodel.ImportExport.handleRestOfLines(ImportExport.scala:338)
	at org.onemodel.ImportExport.doTheImport(ImportExport.scala:397)
	at org.onemodel.ImportExportTest$$anonfun$1.apply$mcV$sp(ImportExportTest.scala:56)
	at org.onemodel.ImportExportTest$$anonfun$1.apply(ImportExportTest.scala:43)
	at org.onemodel.ImportExportTest$$anonfun$1.apply(ImportExportTest.scala:43)
	at org.scalatest.Transformer$$anonfun$apply$1.apply(Transformer.scala:22)
...
Caused by: org.postgresql.util.PSQLException: ERROR: insert or update on table "entitiesinagroup" violates foreign key constraint "valid_group_id"
  Detail: Key (group_id)=(-9223372036854775807) is not present in table "grupo".
	at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2062)
	at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1795)
	at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:257)
	at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:479)
	at org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:353)
	at org.postgresql.jdbc2.AbstractJdbc2Statement.executeUpdate(AbstractJdbc2Statement.java:299)
	at org.onemodel.database.PostgreSQLDatabase$.dbAction(PostgreSQLDatabase.scala:133)
	... 58 more

And, here is another error that was (probably?: found this in notes) addressed by it (i.e., we had
more than one transaction open at a time, because there were more than one mDB var in use):
org.onemodel.OmDatabaseException: Exception while processing sql: INSERT INTO Entity (id, insertion_date, name) VALUES (-9223372036854743788,1407607013269,'likes/dislikes')
        at org.onemodel.database.PostgreSQLDatabase$.dbAction(PostgreSQLDatabase.scala:149)
        at org.onemodel.database.PostgreSQLDatabase.dbAction(PostgreSQLDatabase.scala:214)
        at org.onemodel.database.PostgreSQLDatabase.createEntity(PostgreSQLDatabase.scala:1068)
        at org.onemodel.ImportExport.createAndAddEntityToGroup$1(ImportExport.scala:173)
        at org.onemodel.ImportExport.handleRestOfLines$1(ImportExport.scala:270)
        at org.onemodel.ImportExport.tryIt$1(ImportExport.scala:333)
        at org.onemodel.ImportExport.importCollapsibleOutlineAsGroups(ImportExport.scala:382)
        at org.onemodel.controller.EntityMenu.entityMenu(EntityMenu.scala:214)
        at org.onemodel.controller.EntityMenu.entityMenu(EntityMenu.scala:217)
        at org.onemodel.controller.QuickGroupMenu.quickGroupMenu_doTheWork(QuickGroupMenu.scala:398)
        at org.onemodel.controller.QuickGroupMenu.quickGroupMenu(QuickGroupMenu.scala:26)
        at org.onemodel.controller.QuickGroupMenu.quickGroupMenu_doTheWork(QuickGroupMenu.scala:534)
        at org.onemodel.controller.QuickGroupMenu.quickGroupMenu(QuickGroupMenu.scala:26)
        at org.onemodel.controller.Controller.goToEntityOrItsSoleGroupsMenu(Controller.scala:1487)
        at org.onemodel.controller.QuickGroupMenu.quickGroupMenu_doTheWork(QuickGroupMenu.scala:520)
        at org.onemodel.controller.QuickGroupMenu.quickGroupMenu(QuickGroupMenu.scala:26)
        at org.onemodel.controller.QuickGroupMenu.quickGroupMenu_doTheWork(QuickGroupMenu.scala:534)
        at org.onemodel.controller.QuickGroupMenu.quickGroupMenu(QuickGroupMenu.scala:26)
        at org.onemodel.controller.QuickGroupMenu.quickGroupMenu_doTheWork(QuickGroupMenu.scala:534)
        at org.onemodel.controller.QuickGroupMenu.quickGroupMenu(QuickGroupMenu.scala:26)
        at org.onemodel.controller.QuickGroupMenu.quickGroupMenu_doTheWork(QuickGroupMenu.scala:534)
        at org.onemodel.controller.QuickGroupMenu.quickGroupMenu(QuickGroupMenu.scala:26)
        at org.onemodel.controller.Controller.goToEntityOrItsSoleGroupsMenu(Controller.scala:1487)
        at org.onemodel.controller.QuickGroupMenu.quickGroupMenu_doTheWork(QuickGroupMenu.scala:520)
        at org.onemodel.controller.QuickGroupMenu.quickGroupMenu(QuickGroupMenu.scala:26)
        at org.onemodel.controller.Controller.goToEntityOrItsSoleGroupsMenu(Controller.scala:1487)
        at org.onemodel.controller.MainMenu.mainMenu(MainMenu.scala:73)
        at org.onemodel.controller.Controller.menuLoop$1(Controller.scala:126)
        at org.onemodel.controller.Controller.start(Controller.scala:129)
        at org.onemodel.TextUI.launchUI(TextUI.scala:206)
        at org.onemodel.TextUI$.main(TextUI.scala:28)
        at org.onemodel.TextUI.main(TextUI.scala:1)
Caused by: org.postgresql.util.PSQLException: ERROR: could not serialize access due to read/write dependencies among transactions
  Detail: Reason code: Canceled on identification as a pivot, during write.
  Hint: The transaction might succeed if retried.
        at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2062)
        at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1795)
        at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:257)
        at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:479)
        at org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:353)
        at org.postgresql.jdbc2.AbstractJdbc2Statement.executeUpdate(AbstractJdbc2Statement.java:299)
        at org.onemodel.database.PostgreSQLDatabase$.dbAction(PostgreSQLDatabase.scala:133)
For same reason as prior commit:  a very quick & ugly workaround for problem
described in last commit. Plans are in place for a much better fix at the
right time.
Improve error handling by rolling back a transaction that failed w/ an error,
so the app can go on and do something else.
Style fixes to please the new IDE version's checks.
Fix bug where when finished adding entries to subgroups, it exits out
too far in the menus.
wip