Fixes to basic auth tests

Fixes for crypto hashing

@rcrichton just some fixes for the basic auth. The original tests weren't clearing the clients collection, so we were actually testing the wrong things: i.e. always the first client who was inserted.