Building the 2048 game in AngularJS