A validation function to ensure that javascript data structures match a template structure, and a template function to generate template structures from example data.