Specular and off-specular reflection of polarized neutrons from magnetic thin films and multilayers