Only showing unique order records if searching on attributes of associated models like bill_address or line_items

Fixes #3919
Only respond with js if .xhr? is true

Prevents user private data leak for GET requests from other domains
See discussion on rails-core mailing list
https://groups.google.com/forum/#!topic/rubyonrails-core/rwzM8MKJbKU
Fix compatibility after rails 3.2.16 release

It failed with:

     ActionView::Template::Error:
       undefined method `content_tag' for Spree:Module

Probably due to recent changes in rails i18n api related to the security
patch in 4.0.2, see https://groups.google.com/forum/#!topic/ruby-security-ann/pLrh6DUw998
and https://github.com/rails/rails/commit/78790e4bceedc632cb40f9597792d7e27234138a
better/faster capybara select2 macros

Existing select2 (and variants) used sleep(1) to wait for the select2
dropdown to appear and then executed some javascript to select the
desired option.

This commit replaces that with a standard capybara page.find(...).click.
As well with avoiding the sleep(1), this raises an exception if the
desired option doesn't exist.