Theoretical study on the stabilities, electronic structures, and reaction and formation mechanisms of fullerenes and endohedral metallofullerenes