This was cruft from the old musicbrainz library. Need to test this.
Fixing formatting.
Fixing language
Replacing redundant code with a local static method. Need to revisit this code and break into multiple write() statements and add newlines and spacing.