maggie: Models and Algorithms for Galaxy Groups, Interlopers and Environment