Another 2048 implementation in javascript