Cleaned up the dashboard sorting queries

Cleaned up the dashboard sorting queries and moved them to a
‘pre_get_posts’ filter.