change types from strings to tokens

Types are no longer represented as strings. They all have their own tokens.