First-principles study of crystalline and amorphous Ge2Sb2Te5 and the effects of stoichiometric defects