[ticket/12765] Use db_tools instead of generating queries at moment

PHPBB3-12765
[ticket/12765] Execute query directly from db tools

PHPBB3-12765
[ticket/12969] Add template events around username link on composing pm

Add template event before/after find username link on composing pm
to allow extensions perform additional actions on user finding.

PHPBB3-12969
Merge pull request #2868 from rxu/ticket/12969

[ticket/12969] Add template events around username link on composing pm
Merge pull request #2748 from carlo94it/ticket/12765

[ticket/12765] Use db_tools instead of generating queries at moment