Refactored PathWrapper source for readability.
Added unit tests to confirm functionality.