[WIP] Add support for cross om references.

We use this @OpenSky and it has been quite useful for us. I finally got some time to clean it up a little and contribute it back upstream. Originally written by @avalanche123 and I am pretty sure @jmikola and @bobthecow may have worked on it.