Stats changes

Move stats settings to config file.
Only capture stats if enabled in config file.