Update recreatedb.sql with latest modes table changes.
more APIUser tests
some api unit tests
Transactionalizing the SQL and improving error handling/reporting… (partially complete).
Merge remote-tracking branch 'origin/master' into back-end-working