Add testing for the game

QUnit `assert.equal` arguments order is `actual` first, `expected` afterwards, different from our PHP tests. Please change all parameters that don't follow this structure.