Optomechanical control of atoms and molecules