added tests and database debug panel