Housekeeping update
More housekeeping; caller logging as a method etc.

Also combined some log entry details, such as "current page name" and
"page name", i.e. ones that had identical meaning in the first place.
Add $interval param to cleanup() method

This makes it possible to call cleanup with custom interval, even from
outside module code. Related to planned updates for ProcessChangelog.

Default behavior stays unchanged, meaning that module config setting
data_max_age is still used as a default if no interval was provided.
Bump version number to 1.0.8
Move bulk of database stuff to hooks module

This makes more sense as hooks module is the one that really *requires*
database layer to function properly.
Fix issue with broken ternary operator
Minor improvements to collected detail data
Properly capture publish/unpublish + minor fixes