WIP: generalize categorical to N-dimensions

This will be a problem for Categoricals with only one value (`len(self._codes) == 1`). Using then a method which calls `_replace_codes` will result in a different type