Surface-electrode decelerator and deflector for Rydberg atoms and molecules