Adsorption of CO and CN- on transition metal surfaces: a comparative study of the bonding mechanism