Refactored to mimic HoTT's algebra, added Groups