refactory and add some features on checkers game for nodejs