Split user registration into two files; added input validation and error checking.