Correct splitting of melody lines

Ugly formatting and poor documentation but functional. Will fix both
very soon.
documented

still showing that quirky bug with chords that are too short