Thunderbird 25 changes due to https://bugzilla.mozilla.org/show_bug.cgi?id=452232

So, https://bugzilla.mozilla.org/show_bug.cgi?id=452232 broke a lot.
I don't know what needs to be done for local address books, but for ldap ones I wrote a small working draft for search_mode_1.

More commits to come, so please **don't pull** yet.