Theoretical Analysis of Nanotube Functionalization and Polymer Grafting