A class to validate forms