Better method for getting doc permalink for child doc
Ensure that parent page remains highlighted in edit mode dropdown.

Fixes #293. Props @r-a-y for initial patch