Analytics: count flat badges requests.

Also, allow extending analytics.

Related to issue #185.