token: use alias for pointers

in preparation for changing token pointers to shared pointers, the alias
TokenPtr was added for all Token*; arguments of functions with token
pointers that did not modify the token were changed to a constant
reference (when changed to shared pointers, this will prevent
unnecessary copying of shared pointers); and token pointer
initializations and checks with NULL were changed to nullptr