Initial conversion of calendar-user preferences to use a key-value store.
Updated the update hook to work with the key-value stored preferences.
Fixed SQL in update hook.
Fixed minor bugs with key-value calendar-user preferences implementation.
Fixed mainly indentation and comments.