Error-specific exceptions

Added specific exceptions for each currently encountered error. Replaces
previous system where the exception merely indicated which DLL was the
source of the error.
Connection handling

Initial naive implementation of handling connection opening, errors and
loss. Connection pushed onto a thread, writes into status, etc., not yet
handled in a thread-safe manner.