Make storage of derivatives ready for k-order

This is the first step towards computing k-order derivatives.

Ref dynare#217, #10
1 job for master in 1 minute and 21 seconds (queued for 3 seconds)