Refactor and add test for BatchGroup

[Closes #58]