Ensure tempo track has a track name

Fixes #17.
Refactored some of the MIDI fns to be pure instead of Shake.