Wide ranging update, mostly bug-fixing, but including some as-yet
uncalled methods for MEI export.