Added ThresholdFunction factory.
Refactored activation functions package