OwlFonk/OwlCarousel2 — pull request #90 by witrin (2014-06-01 12:33:10+00:00)
Title: Separates navigation from core

Separates the navigation aspects into several plugins. The first plugin `Navigation` encapsulates the pagination, including the absolute navigation (dots) and the relative navigation (next and previous). The
second plugin `Hash` encapsulates the URL hash navigation.

This refactors the implementation for the pagination. Instead of rebuilding the absolute navigation whenever the core refreshes, it just adds/removes the difference with one DOM manipulation. Thus it doesn't
use data within the DOM elements anymore. Instead this is done by an internal array and the index is the position of the DOM elements.

The core no longer know anything about 'pages'. This is a concept encapsulated with the `Navigation` plugin. Thus the core is kept leaner. But this also introduced a new callback `onTrigger` for plugins. It
allows plugins to extend the event argument before its triggered. In this case to provide the page information with every event.

This also refactors the core by removing the events `animateto`, `update` and `updated`. They are replaced by a more generic approach by extending the events `change` and `changed`, which represent the
changing of an specific property within the core and this property is always included in the event arguments. This approach is very similar to `propertychange` events used in in JavaScript, C# etc. The benefit of
this approach is to keep the namespace of core events keep simple and clean instead of creating for each specific case a new event. It is also easyer to remember. The downside of this approach is that the numbers of event handlers for the events `change` and `changed` are higher.

Besides the events this refactors the public interface of the core by integrating the internal function `gotToLoop` into `goTo` an renaming `goTo` into `to`. Thus `to` operates depending on `options.loop` which simplifies the client code like `next` or `prev`.