Strategyproof Mechanisms for Additively Separable Hedonic Games and Fractional Hedonic Games