A simple JS game engine