Change #hash for board

Make value for #hash correspond to the current state of the board
Add memoization for min_value and max_value