Pulse formation and frequency conversion in dispersion-engineered nonlinear waveguides and resonators