Adds a beforeRouteChange event

With this change it is possible to cancel a locationChange based on
route data. The problem that I am trying to fix here is described in
#5581