Fix back button functionality in AngularJS 1.6+.
Fix back button functionality in AngularJS 1.6+.

Changes to Angular 1.6, specifically:

https://github.com/angular/angular.js/commit/2b360bf30528e636da429396f2fe740c3f97c6f8

Resulted in angular detecting `window.history.pushState` changes.
As a result, the stackables state that is pushed when opening
a stackable was detected by angular on the next digest cycle,
resulting in angular issuing a route change event. This event
cannot be canceled using `preventDefault` as angular's `$browser`
will attempt to revert to the previous history when this happens,
thereby mangling the history. Detecting when to cancel the route
change may also be problematic as the necessary information to
determine whether it's a valid route change may not be available.

Instead, a horrible hack was written to override `onUrlChange`
listeners so that they will not detect any changes to history
state when a stackable is open or when all stackables have been
closed and we are reverting back to the previous history state.

This change also makes it such that links to the same route that
a stackable was opened from cannot be used in the stackable, but
this is generally considered an anti-pattern, defeating the
purpose of using a stackable to preserve the state on the route
it was launched from. So, don't use links like that.

digitalbazaar/angular-stackables