Added +databaseIsOpen and tests and checks for closed databases (fix #50)