Tweaked page name function to deal with _ and sentence case