Sped up candidate detail view SQL
- Added limits to DISTINCT ON subqueries to help Postgres figure out the plan
- Added one index
- Removed unnecessary aggregate functions on GROUP BY columns
- Cast election_yr to int instead of numeric (as Postgres was doing behind the scenes) when doing join
Actual commit is here: https://github.com/18F/openFEC/commit/42abae7b52d9c6c6cf30014f00cd00ecf6737851