Generalise axis handling and improve docstrings.