refactor register and edit profile functions
Merge pull request #9 from chrisshayan/RegisterNewJSAccount

refactor register and edit profile functions