[Fix #351] Fixed sign-up page not redirecting
Also Refactored restore-path.js and added unit tests
Merge pull request #353 from k88hudson/351

[Fix #351] Fixed sign-up page not redirecting