Added AD form authentication login and code cleanup.