Added DiscretePDF custom class and reimplemented DiscreteCDF and DiscreteTPF to inherit from it. Much simplified.