Reorganized threshold models

Introduced make.threshold.model to simplify the threshold model
functions.