Frequency Regulation by Thermostatically Controlled Loads: a Technical and Economic Analysis