Quantum theory of the free electron laser in the laboratory frame