changed how token code is checked

the problem was that in order to check a code in a token, the token
type needs to be checked because only token types that have table
entries have a valid code

modified Token::isCode() to make sure token has a table entry, otherwise
it just returns false

modified users where if they know the token is the correct type, then
use Token::code() and compare to the code, otherwise use isCode() to
make sure token is the correct type first