refactor token class constructors and add test to bearer token