Students at the University of St Andrews have ditched trays to cut food waste and combat climate emergency.