Add playing unit tests

Add unit test for playing.  Misc code cleanup