fix handling of null in Record.isChanged()
make Database.close() destroy its transactions
various Cache fixes