dropCwd rewritten using path function + add tests