Added support for chunking files rather than per line