Add logoff function. Add Appointment database handlers.
Tidy code. Add minor functionality.
Merge remote-tracking branch 'origin/master' into JansBranch