Implement isValidPath and expandPath

@aybabtme

Path helpers we (mostly you) worked on today.