add functions to smooth trip assignments over a time window

Sort a recarray on device_id and time, select trip assignments from a
given window (in time or sequence length), and update the trip
assignment based on the mode of the previous assignments. The
motivation here is to smooth out blips in the trip assignment due to
e.g. a bus passing others along a given route (possibly headed in the
opposite direction but at a similar location in time and space).