ENH: Explicit import of modules into the space in core/__init__.py

Otherwise there is no strict guarantee that they would be available
later on during population of __all__.

This issue was ran into while opening a python file in emacs with python-mode
and ropemacs:

Loading pymacs...done
Pymacs loading ropemacs...
File mode specification error: (error "Python: Traceback (most recent call last):
  File \"/usr/lib/python2.7/dist-packages/Pymacs/pymacs.py\", line 146, in loop
    value = eval(text)
  File \"<string>\", line 1, in <module>
  File \"/usr/lib/python2.7/dist-packages/Pymacs/pymacs.py\", line 246, in pymacs_load_helper
    object = __import__(module_name)
  File \"/usr/lib/python2.7/dist-packages/ropemacs/__init__.py\", line 4, in <module>
    import ropemode.interface
  File \"/usr/lib/python2.7/dist-packages/ropemode/interface.py\", line 3, in <module>
    import rope.base.change
  File \"/usr/lib/python2.7/dist-packages/rope/base/change.py\", line 2, in <module>
    import difflib
  File \"/usr/lib/python2.7/difflib.py\", line 36, in <module>
    from collections import namedtuple as _namedtuple
  File \"collections.py\", line 16, in <module>
    import numpy as np
  File \"/usr/lib/pymodules/python2.7/numpy/__init__.py\", line 137, in <module>
    import add_newdocs
  File \"/usr/lib/pymodules/python2.7/numpy/add_newdocs.py\", line 9, in <module>
    from numpy.lib import add_newdoc
  File \"/usr/lib/pymodules/python2.7/numpy/lib/__init__.py\", line 4, in <module>
    from type_check import *
  File \"/usr/lib/pymodules/python2.7/numpy/lib/type_check.py\", line 8, in <module>
    import numpy.core.numeric as _nx
  File \"/usr/lib/pymodules/python2.7/numpy/core/__init__.py\", line 30, in <module>
    __all__ += numeric.__all__
NameError: name numeric is not defined
")
Merge pull request #286 from yarikoptic/master

Explicit import of modules into the space in core/__init__.py
Merge pull request #285 from njsmith/add-tox

Add a little command-line tool for running tests, plus tox support
ENH: Make internal per-op nditer flags type a typedef

There are 8 flags now, so to add another one requires
bumping up the size. This change makes that easy.
Also, because the internal structure of nditer is
not exposed to the ABI, we can change it at will.
BUG: Add a new flag to nditer to indicate when op uses buffering

Thouis tracked down an intermittently occurring bug in
ticket #2144, where a reduction under certain situations
would produce wrong results. This occurs when the array
data and the nditer's buffer happen to be adjacent in
memory.

This fixes it by replacing the "clever" trick of checking if
the iterator's pointer is in the buffer with an explicit
flag to signal buffer usage. The reason this can't be reliably
handled via the pointer/buffer check is that the pointer updates
are handled by the consumer of the iterator, who may update
them in place or may use local variables instead. Thus, the
pointer could still point to the beginning of the buffer, or
could point at the byte immediately after the buffer. Using
a flag avoids all of this and should be reliable.
DOC: Remove duplicate unique links in HOWTO_DOCUMENT.
BUG: '-framework Python' is not needed and can interfere.
BUG: add missing test data in bento build.
BUG: add missing f2py files in bento build.
BUG: install required generated headers.
BUG: add missing umath_tests extension to bento build.
REF: use simpler API in top bscript.

We use the new register_outputs_simple + remove some redundant code.
REF: simplify extension customization.

We are using the new tweak_* bento API wherever possible.
BUG: fix CBLAS/LAPACK detection logic.
Merge remote-tracking branch 'mwiebe/nditer_buffer_flag' into merge-293
Merge branch 'master' into clean-up-diagonal
Remove maskna API from ndarray, and all (and only) the code supporting it

The original masked-NA-NEP branch contained a large number of changes
in addition to the core NA support. For example:
 - ufunc.__call__ support for where= argument
 - nditer support for arbitrary masks (in support of where=)
 - ufunc.reduce support for simultaneous reduction over multiple axes
 - a new "array assignment API"
 - ndarray.diagonal() returning a view in all cases
 - bug-fixes in __array_priority__ handling
 - datetime test changes
etc. There's no consensus yet on what should be done with the
maskna-related part of this branch, but the rest is generally useful
and uncontroversial, so the goal of this branch is to identify exactly
which code changes are involved in maskna support.

The basic strategy used to create this patch was:
 - Remove the new masking-related fields from ndarray, so no arrays
   are masked
 - Go through and remove all the code that this makes
   dead/inaccessible/irrelevant, in a largely mechanical fashion. So
   for example, if I saw 'if (PyArray_HASMASK(a)) { ... }' then that
   whole block was obviously just dead code if no arrays have masks,
   and I removed it. Likewise for function arguments like skipna that
   are useless if there aren't any NAs to skip.

This changed the signature of a number of functions that were newly
exposed in the numpy public API. I've removed all such functions from
the public API, since releasing them with the NA-less signature in 1.7
would create pointless compatibility hassles later if and when we add
back the NA-related functionality. Most such functions are removed by
this commit; the exception is PyArray_ReduceWrapper, which requires
more extensive surgery, and will be handled in followup commits.

I also removed the new ndarray.setasflat method. Reason: a comment
noted that the only reason this was added was to allow easier testing
of one branch of PyArray_CopyAsFlat. That branch is now the main
branch, so that isn't an issue. Nonetheless this function is arguably
useful, so perhaps it should have remained, but I judged that since
numpy's API is already hairier than we would like, it's not a good
idea to add extra hair "just in case". (Also AFAICT the test for this
method in test_maskna was actually incorrect, as noted here:
   https://github.com/njsmith/numpyNEP/blob/master/numpyNEP.py
so I'm not confident that it ever worked in master, though I haven't
had a chance to follow-up on this.)

I also removed numpy.count_reduce_items, since without skipna it
became trivial.

I believe that these are the only exceptions to the "remove dead code"
strategy.
Move reduction.{c,h} from multiarray/ to umath/

This is done as a separate commit to make sure git can track the
change. This commit will not build. See next commit for actual changes
and rationale.
Remove PyArray_ReduceWrapper from public API

There are two reasons to want to keep PyArray_ReduceWrapper out of the
public multiarray API:
 - Its signature is likely to change if/when masked arrays are added
 - It is essentially a wrapper for array->scalar transformations
   (*not* just reductions as its name implies -- the whole reason it
   is in multiarray.so in the first place is to support count_nonzero,
   which is not actually a reduction!). It provides some nice
   conveniences (like making it easy to apply such functions to
   multiple axes simultaneously), but, we already have a general
   mechanism for writing array->scalar transformations -- generalized
   ufuncs. We do not want to have two independent, redundant
   implementations of this functionality, one in multiarray and one in
   umath! So in the long run we should add these nice features to the
   generalized ufunc machinery. And in the short run, we shouldn't add
   it to the public API and commit ourselves to supporting it.

However, simply removing it from numpy_api.py is not easy, because
this code was used in both multiarray and umath. This commit:
 - Moves ReduceWrapper and supporting code to umath/, and makes
   appropriate changes (e.g. renaming it to PyUFunc_ReduceWrapper and
   cleaning up the header files).
 - Reverts numpy.count_nonzero to its previous implementation, so that
   it loses the new axis= and keepdims= arguments. This is
   unfortunate, but this change isn't so urgent that it's worth tying
   our APIs in knots forever. (Perhaps in the future it can become a
   generalized ufunc.)