Fix bad XML syntax (&amp; and &gt;)
Rewrite trails processing with more flexibility.

Some rendering differences are present, most significantly a much
higher number of scenarios and corner cases are handled.  Related XML
shrunk by an order a few dozens.
Drop copy_tracks.py which is no longer compatible.