Purification of nanotubes