Changed to use Matrix rather than Dense
Changed so there is no modification of features or weights
Added diagonal type
Added BatchDerivative struct and lots of auxiliary types