Compatibility with turbolinks and pjax handling of pushState

turbolinks (https://github.com/rails/turbolinks) and pjax (https://github.com/defunkt/jquery-pjax) provide fast page loading by loading links using AJAX and replacing the page content. Both libraries uses pushState to provide a working back button. turbolinks is included by default in new Rails 4 projects.

When using dynatable with turbolinks or pjax, the initial replaceState prevents the back functionality from working properly when navigating away from a page with dynatable then clicking back (no turbolinks or pjax refresh occurs).

The fix is to merge the current pushState with the dynatable state in the push method.

The new behavior can be turned off with settings.features.addToPushState = false