Factored out metric recorder into its own class. Added feature toggle for metrics recording. Exposed feature toggle via jmx.