Added email threading for update emails on issues and merge requests (if the mail client support the References: mail header)
Now using correct ids as reference if we are informing about a new note.
Added some tests.
Merge pull request #6109 from jamit/master

Added email threading for update emails on issues and merge requests