Initial stab at some socket logic. TODO: Move IPC connections into a separate thread with its own event loop.