reorganize mock LDAP server code