Add pluggable validation for PathBuilder

Fixes #975
Sounds reasonable. I could do that tomorrow.