Porting changes from picketlink2/federation.
Improvements and more test cases for the LDAP store.