Refactoring complete. Minimax working.

Refactored the code to remove all globals and prefix names. Naive minimax
also working. Simple timer implemented but not tested.