BUG: check for monotonic bin arrays in digitize

The check for monotonic bin arrays of digitize doesn't properly handle
inputs with repeated entries at the beginning of the array:

```
>>> np.__version__
'1.8.0'
>>> np.digitize([1], [0, 0 , 2])
array([2], dtype=int64)
>>> np.digitize([1], [2, 2, 0])
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ValueError: The bins must be monotonically increasing or decreasing
```

Modified `check_array_monotonic` in `_compiled_base.c` to skip over repeating
entries before deciding to check for increasing or decreasing monotonicity
and added relevant tests to `test_function_base.py`.
STY: adapted code to `C_STYLE_GUIDE.rst.txt`.
MAINT: rewrote `check_array_monotonic` to use array indices, not pointers.
TST: tests for proper handling of bins with all items almost equal now check
     the return value for correctness, not just that an error is not raised.
MAINT: hide symbols that shouldn't be exported
MAINT: rewrote `check_array_monotonic` following @charris suggestion to
       minimize indexing.
Merge pull request #4247 from jaimefrio/digitize-monotonic

BUG: check for monotonic bin arrays in digitize
Merge pull request #4279 from juliantaylor/symbol-cleanup

MAINT: hide symbols that shouldn't be exported
ENH: single pass over array in `bincount` to determine output size
`bincount` checks its input array to make sure there are no negative entries,
and to determine the size of the output array. This is done by calling two
different functions, each having to loop over the whole array. This PR
adds a new function, `minmax`, that computes the minimum and maximum of the
array in a single pass over it. This leads to speed-ups peaking at 1.5x,
with typical values for large arrays around 1.15x - 1.25x.

A full benchmark summary of the new implementation, including a supposedly
more efficient algorithm that turned out to run slower, can be found [here](https://gist.github.com/jaimefrio/8743836).
MANT: Use local variables for `min` and `max` inside `minmax` function.
MANT: rebase conflicts