Phase Transitions and Near-Critical Phenomena in the Abelian Sandpile Model