Fix autogen of keys, use pgsql sequence tables
Misc fixes to daos and services
Added tests for activityDao