Statsd

This is a rebased and slightly modified version of PR #892.

It enables statsd globally.