ENH: add np.nan funcs to _cython_table
closes #19629 
closes #21134
- [x] tests added / passed
- [x] passes `git diff upstream/master -u -- "*.py" | flake8 --diff`
- [x] whatsnew entry

This started as a copy of #19670 by @AaronCritchley, but has solved two bugs that the tests surfaced along the way.

Bug 1:
there is currently a bug in ``df.aggregate``, where the method incorrectly defers to ``df.apply`` in a corner case. This only shows up in the result when using numpy < 1.13 and passing np.nan* functions to ``df.aggregate``. This is the reason for the change in ``base.py`` line 571. (see #8383 for further details on the bug in numpy<1.13 and how it affects pandas.)

Bug 2:
Passing builtins to ``df.aggregate`` is ok when ``axis=0``, but gives wrong result,when ``axis=1`` (#21134). The reason for this difference is that ``df.aggregate`` defers to ``df._aggregate`` when ``axis=0,`` but defers to ``df.apply``, when ``axis=1``, and these give different result when passed funcions  and the series/frame contains Nan values. This can be solved by transposing df and defering the transposed frame to its ``_aggragate`` method when ``axis=1``.

The added tests have been heavily parametrized (this helped unearth the bugs above). Thet have been placed in ``series/test_apply.py`` and ``frame/test_apply``, as a lot of other tests for ser/df.aggregate were already there. 