REFACTORING: LDAP authentication as a module.

Warning: The format of `config.json` (or `config.js`) has changed.
Use `authenticate(ldap, ...)` or `authenticate(dummy, ...)` 
for authentication.
FIX: Match virtual hosts.

Bug introduced in 513d403812444e49a18e52139c3c8bf1f15ff972.
REFACTORING: Minor.
REFACTORING: Basic HTTP authentication.