Factor out general functionality of path oracles to the library