When factories began mass producing clothing, furniture, and farm machines what did they often use as an energy source?