Refactoring JS, Fixes for Search UI

Refactored a lot of frontend code to get model out of controllers, UI improvements, and other tweaks:

- preserves search selections across tabs/search modes #74 
- badge values for search selections #44 
- fix for map region deselection bug #100 
- Initial work towards CSV downloads too (but realized that I had to preserve the API query params first, led to refactoring) #46