Gaussification and entanglement distillation of continuous variable systems: a unifying picture