Speed up array.flat() for C-contiguous arrays
Merge branch 'ndadapt_refactor' into flat_speedup

Conflicts:
	numba/_helperlib.c
	numba/targets/arrayobj.py
	numba/tests/test_numpyadapt.py
Refactor a bit
Optimize flat() implementation for non-contiguous arrays.
Speed up C-contiguous flat() by 15% more by keeping track of the current pointer
(speedup should be larger on arrays with non-trivial item sizes)
Merge branch 'master' of github.com:numba/numba into flat_speedup
Remove spurious if-else
Use itemsize rather than strides[-1] when iterating over a C-contiguous array (it's more correct)
Merge branch 'master' of github.com:numba/numba into flat_speedup

Conflicts:
	numba/_helperlib.c
	numba/targets/arrayobj.py
	numba/tests/test_numpyadapt.py
Merge pull request #817 from pitrou/flat_speedup

Speed up ndarray.flat()
compile_internal generates the cache key

Passing a cache key to compile_internal is error prone and
laborious, so this commit changed compile_internal to generate the
cache key. This also enables caching for all calls to it, some of
which were previously not enabled because they passed no
cache_key.

This also adds a test for the caching, which checks the size of
the cache after the compilation of functions to determine whether
the cache is being used correctly.
Add additional check with different type

Add an additional check for the same function with a different
signature, in order to ensure that the cached version isn't
incorrectly picked up.

Also simplify len(list(...)) to len(...)
Add docstring, remove keys() in test_compile_cache
Merge pull request #839 from gmarkall/autogenerate_cache_key

`compile_internal` generates the cache key
WIP Many feedbacks integrated.
Merge branch 'master' into reductions

Conflicts:
	numba/targets/arrayobj.py