fix the priority bug in the update process. But bug still exist in snake.update
Add testing framework.