Bug fixes, and added modifier_append2playlist

Also reworked player_main to use a while loop (rather than a for loop) as main form of control flow. This allows us to add trials on the fly if we need to whereas the for loop would not allow us to do this.