Add new token system which enables one-shot access to the API functions without requiring to log in.

1) To create a new token (only when logged in):

http://chris/daniel/api.php?action=get&what=token

returns something like
5151b20091de3

2) To use the API with a token:

http://chris/daniel/api.php?token=5151b20091de3&action=get&what=token

Yes, this example uses a token to generate a new token :)

Also, a token does not contain any user information so API functions relying on the userid will not work.

Once a token is used, it is invalid.