Overhaul link reference definitions. The new process is similar to CommonMark.js, where reference link definitions are parsed with block nodes, and inline nodes are parsed after all block nodes have been parsed.