Update API to understand sources properly

Too many changes for one check-in:

 - add instances state to API so that non-running instances can be found
 - add default filter function (used to filter out non-running instances in the default view)
 - keep track of all source update attempts (including errors)
 - add new sources API endpoint that provides health data on sources
 - introduce origin filter maps so that sources can be excluded from staleness calculations if it is impossible for a result to come from a source (e.g. the vendor doesn't match)
 - move filter code to separate file
 - re-implement old endpoints in terms of new `ApiResults.mr` handler
 - extract out json writers into new package