Refactor the link-tracking code and move it from framework.

This code has a dependency on SiteTree, so it fits much better in the
cms module.

Abstracted away the content parser so the same code can be reused both
in the render phase (to highlight the links) and in the write phase
(storing information about broken links and references).
You already defined `$value = $this->owner->customisedObject` at the top of this method, can you just re-use that?