Structure and stability of binary calcium–carbon compounds: a comparative ab initio and DFT study of CaC2