Created a lot of the backend functionality for snake movement.
set up functionality to prevent snake movement in opposite movement