Authentication against Active Directory subdomains

This patch enables authentication against specific AD subdomain extracted from the username.
E.g. for configured domain name "example.com" user "north\tom" will be authenticated as "tom" against "north.example.com".

Review request is on http://reviews.reviewboard.org/r/2838/