Pull over PathManager code from 2015 and merge.