A versatile method for analyzing paraxial optical propagation in dielectric structures