Gradients1

Another chunk of #192.