Connection threading update.

Solves #6.