Validation complete milestone #A

Function complete (from what I can see, at least.) What's left is to use
it in real projects and refine based on real usage.