Refactor #sort_link to extract mutation and order-dependent
Refactor #sort_link to extract mutation and order-dependent

code into a single `initialize!` method and reduce what was previously
a large, 100-line method with values mutating from start to finish,
into a 5-line method that calls other small, order-independent,
mutation-free methods.

Consider this an experiment. It could be much better. There is a bit
more to do and improve, and a few places where I think the code can be
optimized to run faster.

The two form_helper methods could probably benefit from much better
documentation in the code itself, to help developers who would like to
improve it and submit PRs.

mariorcardoso/ransack,AndrewSwerlick/ransack,outstand/ransack,martndemus/ransack,Eric-Guo/ransack,guilleva/ransack,avit/ransack,Mario245/ransack,laserlemon/ransack,activerecord-hackery/ransack,johan--/ransack,roman-franko/ransack,nagyt234/ransack,reinteractive/ransack,vaski/ransack