Recognizing Even-Cycle and Even-Cut Matroids