Nonlinear theory of free-electron lasers and efficiency enhancement