Macaulay-Buchberger Basis Theorem for Residue Class Rings with Torsion and Border Bases over Rings