A General Machine Learning Framework for Survival Analysis