Add tests for tokenhandler