Improved the main loop.

Direct cut if we are on a "play against" node.
Added a user-defined cutting function.