Added time parameter to d.by.dt to allow choosing the timetags
if the result: -1=prev,0=mid,1=next
more change of periods to underscores in variable names
added datasets function