numpy.gradient enhancement to use second order accurate difference over the full domain

This is a pull request related to issue https://github.com/numpy/numpy/issues/3603 .

The changes to the gradient function work as expected for float and int datatypes, and improve the accuracy of the derivative. However, the function can not yet deal with date and time datatypes.

Please run test_function_base.py tests or see the build errors viewing the Travis CI below.

**Could you suggest how to improve the function so that it works with date and time dtypes?** I don't understand this part of the gradient function so I don't know how to filter them out.