First Principles Study of Work Functions of Single Wall Carbon Nanotubes