Faster trj slicing/better tmp dir handling