moved return-type logic to iterate() because it's broader and reduces redundancy. added string return type. minor formatting fixes
moved return-type logic to iterate() because it's broader and reduces redundancy. added string return type. minor formatting fixes

jdan/Melopy,juliowaissman/Melopy