detect game over and fire an event
refactor js a bit
make index be the vulcanized version