add references support for rails4, and use it when searching with includes instead of search_joins
move some methods related to queries from Actions::Core to Finder
set references when sorting by a column with includes, order by association columns is assumed in this case