Refactoring of half-edge grid implementation

Extract common functionality and algorithms from half-edge grid implementations to define a more abstract interface and reduce the complexity of indexSet.

Add adapter for specific implementation if needed.