Added classes to support multi-threading of backpropagation.