Updates/fixes/improvements to music library

This is mostly @night199uk's work, rebased up by me (and quite thoroughly checked).

I'm sure bugs will no doubt have crept in nonetheless.

PR so that things can be build tested.  Folk are welcome to review (and test!) if they wish - this is Gotham material.

Builds on top of the XSLT stuff which should ideally go in separately.