Optimized minimax with alpha-beta, also heavily optimized availableMoves() function