Improve ldap sync

See Pull-Request 166 - now against master and with some "documentation". Where shall I send the CLA?