few new functions

added a few functions: _sort() keeps a sorted-by-date python list as an internal data structure, starts_within() which checks if an object starts within the time peroid of another object passed into it