Code to pickle models.