Allow "apply_function" as a public function

Previously, `_apply_along_axes` was private (and misnamed w.r.t. plurality).  It makes sense to allow users to apply their own functions.  For example, there are some numpy functions (`mean`) that I wanted to apply to the data and didn't have any way to do it.

It would be good to do the same thing for the `_apply_numpy_function` tool, but that one is a little more complicated to deal with and has a deeper dependency tree.

Also, right now `apply_function` has no tests!  Tragedy and travesty!
Probably just my personal taste, but I really dislike locals() and globals(). I'd prefer:

```
try:
    out
except NameError:  # out not yet defined
    out = ...
```