Nearest Neighbour Based Estimates of Gradients: Sharp Nonasymptotic Bounds and Applications