Fix #83, improve badges

This moves most of the badge fetching away from the view and caches the
different badges so that it is not necessary to access the file on disk
each time.
.first() ?