change note metadata updater to something more robust (with tests).

using XML parser instead of silly regex looping.
remove legacy metadata attribute handling code