Fixed flags for animations finally. Added some playstate tests in jquery