ENH: Add <ipmatches> and <ipjailmatches> tags

Example use filter also added for sendmail-whois with ipmatches rather
than grepped lines
ENH: Make use of functools.wraps for server.database decorators
ENH: Refactor and add database matches and failures for sendmail actions
ENH: Add cache for database getBansMerged

This is avoids duplicate queries when using the ip(jail)matches and
ip(jail)failures in actions
BF: Database test keep ticket present in memory so address is reused

This bug only seemed to effect python2.6 which seemed hasty to reuse the
memory id that was assigned to the ticket which was being used for
reference
Merge pull request #491 from kwirk/ipmatches

ENH: Add <ipmatches> and <ipjailmatches> tags + sendmail implementations