Performance improvements sorting and done message

Removes bottlenecks from sorting and checking the DONE message on each event.

Uses heapq.merge instead of zipline's sort module.

Uses StopIteration instead of maintaining knowledge of a 'DONE' packet.