Adds toToken and toTokens methods.