4th Revision

Added Login/Register functionality as well as various cleanup.