Properties of Residues from Sublimed Dirty Ice: Implications for Comets and Martian Polar Deposits