Band structure and enhanced photocatalytic degradation performance of Mg-doped CdS nanorods