Implement basic auth
Implement basic (username/password) authentication.

Closes issues #1 and #8.
Note that this is associated with a change to apitoken.pl, and hence that will be necessary for the basic auth to work correctly.