Adds support to preserve URL path when redirecting

I think this pull request is pretty self-explanatory ;-)
We are using it for our app, thought this would also be interesting for other people that build single-page apps with device.js