Basic authentication

Needed to implement basic auth for my staging server.  I know it's not exactly what your module was designed for but it seemed like a good place to put it.  Not sure if you might want to merge this in or not.

Thanks!