Moved all logic into neat, orderly functions. Now prints only the csound score portion.