Added example test hook usage
Testing with file-backed DB
Turning off db.close() debug plus minor refactoring.