Added auto collection of app/environment metrics.

Resolves #2.