Add test for Eigen::Ref support.
differentiable-function.hxx: avoid allocation.
function.hh: store dense matrices row-major.
ref.cc: improve test.