Wrap the validation up in a class. Rename the file to match the class name. Move the example usage out from the file that defines the class
Move the example files into the doc/ dir.