added i/o based iteration and filtering

Added an I/O iterator that returns I/O chunks. Implemented an I/O filter for
converting references into I/O chunks. Rearranged I/O definitions to be used
throughout the project.