adding a path helper to consolidate path manipulations

this is the first step for https://github.com/jackalope/jackalope/issues/90

if this looks fine we can already merge, but i want to tag a new version of phpcr-utils once jackalope is all updated to use this and its proven to be correct and complete, so jackalope can depend on the right version of phpcr-utils