Improved statsd agent and actor count

This is a big PR, which follows up on #63 by tidying up the code, improving the configuration and adding tests.

Close #39.