implemented play/pause and tightened up a lot of things. This is near
the final version.