Major overhaul of reference handling

This modularizes the reference handling into two phases.

Phase 1: classifies all bracketed text (semi-colon delimited) as references and inserts dummy to_link rid attribute

Phase 2: aligns these with valid bibliography tags