[#725, #630] Fix breaking of partner sites

Work around the SQL query that hangs by assembling the list of countries
in python instead.

Use prefetch_related() to (hopefully) minimize the number of queries
needed.
[#630] Add piwik tracking code to parter sites widgets
Merge pull request #726 from akvo/feature/630_sites_piwik_tracking

Feature/630 sites piwik tracking