Improve LDAP filter handling

LDAP filter is now represented by a list of tokens. The filter is
constructed during processing of config file. The filter can be easily
modified by substituting tokens with strings. All the user inserted
strings are escaped to prevent filter injection.