Improve client db

this adds the functionality mentioned in #7 
the first part checks if the key is allowed, the second part moves on to type validation. I use none to indicate that the type can be anything, because the username could be unicode or str. I can change this to something more readable like allowed_keys[key] != "string"