Thiolation of carbon nanotubes and sidewall functionalization