First principles study of structural, vibrational and thermodynamic properties of carbides, nitrides and oxides of several elements