Adds a plugin.misc helper function get_parent_directory with tests
Fixes a mistake in a unit test and removes an extra space in docs
Merge pull request #1192 from bmbouter/1149894

1149894 - Adds a get_parent_directory that gets it right with a trailing slash