Removes code duplication in pitch spell (for separating Ly and XML export)

See #52
Cleaning
Moved spelling

See #52
Moved export functions

See #52