File splitter with tests