RF: Add numpy 1.8 gradient function in to smoothen the transition to 1.9

http://mail.scipy.org/pipermail/numpy-discussion/2014-October/071334.html