Refactored register form page, now uses functions to complete most tasks
refactored register form to use functions