Reconstruction and energetics for surfaces of silicon, diamond and β-SiC