Add support for token-based login to Client

This adds support for logging in using an API token in addition to a password. If both token and password are specified in configuration, token is given preference.