Superconductivity and electronic structure in MgCNi3