Added Trainer class and tests for learning NOT, AND, OR, and XOR.