Nonlinear Optical Cavity Dynamics: From Microresonators to Fiber Lasers