Use pages class for gettings description, keywords, etc when they are set.

Do not perform separate query to get attributes for <head>. Instead, load
pages class early.

Check if($pages->description) to see if metadata is available, since pages
class will return a boolean false when trying to get data that is not set.