Add groups support

Started writing a script that needed to be able to look up groups, so I started writing the functions to look up groups. Also wrote tests.