Fire `pjax:beforeReplace` event before replacing HTML

This event fires right before DOM replacement and it's useful if any
processing of old content is required, such as unmounting components.

This is similar to the equivalent event that Turbolinks [1] fires.

Fixes #383

[1]: https://github.com/rails/turbolinks
Document `pjax:beforeReplace` event
Merge branch 'before-replace'

Fixes #383, closes #384