Separate IO to a different thread

@oxmane Please CR