Remove MAX_DIM
Description
Remove the MAX_DIM macro, finishing something I started a long time ago.
This includes a few related improvements.
News snippet
Remove the MAX_DIM macro.
Checklist
-
I have checked that my code follows the Octopus coding standards -
I have added tests for all the new features added in this request.