Documentation updates, coding style tweaks, added missing __METHOD__ (for profiling) to a DB call in deleteEntryIfNeeded().