All networking and file writing is now done in a separate thread.