Functionalization of 2D materials by intercalation