[ticket/11486] Root path function created and existing code refactored

A method called get_root_path() was created to make getting the root
path easier. Existing uses of $root_path were updated to use this method

I ended up re-doing the ticket/11486 branch instead of fixing all of those bad commits. Now everything is reduced down into one commit. The old pull request can be removed.

PHPBB3-11486