Separate GMM-related functions and types to gmm.jl