Cleanup and documentation of validation lib