Revert "[#861] Use the .get() function to look for 'q'"

This reverts commit 067d43006fd542eee7a0a9a11fdec5f42c02add4.
Revert "[#861] Remove 'metadata_modified' from if"

This reverts commit 655c2dd9d8e9ca7e6cbddf2d6d993262a8024a08.
Revert "[#861] Change the logic for sorting dataset search"

This reverts commit 9d6f9dceb21e3e53f36a4fed44587b2e89c5ad19.