Unstable optical resonators and waveguides