XD-542 Refactor Module to include group and index

Module represents an instance (defined by group and index)
but most APIs passed module, group, and index around.

Encapsulate the group and index and change APIs to just pass
the Module.