Fix `contents()` so that it no longer returns unrelated items
This should fix the return of unrelated contents. Previously we only checked that the number of leading path components was the same, but we should have also checked that the actual path components were the same too.
Closes #44 (closed)