Valence force model for phonons in graphene and carbon nanotubes