Refactored HibernateUtil and made the register form send emails