Refactored mastermind.py

Reduced size of runGame() function, split components into their own
functions.