Fix unit and system specification tests
Add more unit specification tests against the application
Fix defect calculating nextId and inserting in empty database
Merge branch 'master' into heroku