Fix infinte loop eating all CPU time, refactor ChunkGenerator, it seems to reliably generate and send all chunks now.