Use structured errors during validation

I don't think these functions are really making things clearer than just returning ValidationError{type, "field", field} everywhere. But I don't feel very strongly about this, so do whatever seems clearest to you.