Added stop and start events to allow d3 event-driven code to run more smoothly.