Cleaned up code, added facilities for alpha beta pruning.