configure_authentication - rewrite to improve logic and improve script speed.

Order changed so that configureing nslcd is last.