Jan 20 2021; Update 1.40

Now handles herd.ar1v(td) where td has many levels,
idv(herd).ar1(td) is equivalent and works.
Fixed some bugs when using grouped variables; some functions accessed the wrong data variable