Access token database

Refactored the code according to the comments and added test cases.
Curious about your choice of using a dictionary here. Also interested in knowing why you chose Int16 and not just an int. How you would get the value of a unique int key for each access token value?