Refactored getting total search results
Refactored facet filter display
Refactored display of results
Refactored display of results header
Refactored getting response from API
Refactored display of next/previous links
Refactored code for no search
Refactored to detect API failure earlier
Simplified next and previous position calculation
Simplified next and previous link code
Refactored parameter defaults
Split out function to display results
Split out code to display links to other pages
Renamed ambiguous variable