Formatting cleanup for WP code standards
Use get_post() rather than the global $post object
Use get_permalink() and get_home_url() to build classes

Reworks the logic to use get_permalink() as a base for determining
depth, section, sub-section, and page from an individual page view.