updates examples so they're not dependent on PHP
fixes "sleep" bug

pretty major rewrite
- moved everything into a JS object, making scope easier
- using events and state to track where the timer is
- using the server's seconds to instantiate a JS Date and then basing the events on that, rather than # of seconds