Resove issue #18 (Default <head> on no database)

Get $head from database only if $DB->connected and provide fallback.

Only load $pages if $DB->connected too.