First principles study of small cobalt clusters encapsulated in C60 and C82 spherical nanocages