basic metrics collection

stored in a ttl-based mongodb collection, turned off by default.
enable this with the 'enable_metrics_collection' config parameter

no web interface support yet.