Feature time arithmetic

Contains scoping, temp arithmetic and time arithmetic