Motion text truncation

This is a work in progress to fix #305. I don't want it merged yet as I want to get Ruby and PHP creating the exact same output to ensure the Ruby importer is working. That means this can only happen after I've done that.

There's also more work TODO: remove the `.truncate` and do the same thing for pwmotiontext-generated motion text.