cleanup and optimize path resolver

- store actual root when partitioning
- handle dot directory correctly
- memoize partition_path
- add is_unc? method
- optimize and format code