replaced for...in constructs with iteration over Object.keys() in hot spots.