Magnetic and binding properties of Co-doped single-walled carbon nanotubes: a first principles study