Gravitational waves from inspiraling compact binaries: Angular momentum flux, evolution of the orbital elements, and the waveform to the second post-Newtonian order