[#861] Change the logic for sorting dataset search

Default to metadata_modified desc if no query and relevance if there is
a query.
[#861] Remove 'metadata_modified' from if

Also, modify the default sort order if there is a search query to be
"score desc, metadata_modified"
[#861] Use the .get() function to look for 'q'
Merge branch '861-order-by-dropdown'
Merge branch 'master' of github.com:okfn/ckan