Cleaned up main into learn, predict, test methods