Merge remote-tracking branch 'origin/3.1'

Conflicts:
	docs/en/misc/contributing/issues.md
	docs/en/reference/uploadfield.md
	forms/HtmlEditorField.php
	i18n/i18n.php
	javascript/HtmlEditorField.js
	model/DB.php
	model/Image.php
	model/SQLQuery.php
Merge pull request #3379 from mateusz/merge-back

Merge 3.1 back
Move the link-tracking into the cms to remove the SiteTree dependency.

Depends on 8996b67c13a773c3339f45d91bf2378a39e5178a in the cms module.