What is the difference between electric motors and electric generators? How do they convert electrical energy and mechanical energy using magnets and coils?