Add add_field method to Form; miscellaneous cleanup and testing.