analytic gradients for sd, variance, new vari impl for stored gradients, plus tests, doc