Polarized Radiative Transfer in the Magnetospheres and Atmospheres of Neutron Stars