Significantly sped up server->client communication by re-polling as soon as data arrives. Also fixed a null-pointer bug