IO: implement resize

Closes #11