Added more tests for authentication and made dbtest library