Refactoring sidebar, sort, filter helper_methods

To reduce re-useable code, these helper_methods are moved to
application_controller.rb