Replaces window.location hacks to app.navigate