a bunch of changes related to cref and href handling