Note can be deleted from the note list (via Ajax).
Many minor changes resulting from unit testing.
Fixed referential integrity errors. Plus many minor changes resulting from unit testing.