Add basic auth support.
Remove old code to make this work.
Merge branch 'basic-auth'