Require first and last name during registration

The registration form has fields for "First Name" and "Last Name" but they are not required. The following code will make these fields required and will display error messages if they're not filled out.