Valence and Core Photoemission in M@C60 (M=Be, Mg, Ca)