Rearranged Tictactoe to separate IO from rest

Physically moved lines of code to separate pure code from IO code