Added time shifting methods, tests, misc code cleanup