Start to rewrite test_coordmap into a standalone liftover tool.

Not entirely working at the moment - seems to segfault.
Merge stuff that I hadn't merged. Sorry.