Fixed previousUrl value

When using browser's back button, the previous url value was not good (document.location was the url we are going to). So, when calling goto when browser history is changed, we will pass the previous url.
Merge pull request #3 from beaubbe/patch-1

Fixed previousUrl value