Refactored files, fixed bugs.

Moved D3 to separate js file.

Fixed inbound/outbound corresponding stops bug.