Fix border color rules.
Enhance footnote hilarity.
Improve note positioning algorithm.

Notes now prefer to be on the side of the text that their link
is closer to.  (In practice, this is often the left because
of links that break across lines.)  If they can't be placed at
their preferred height on either side, they prefer to be
placed on the side that leaves them higher up the page.