Fixed bug in FilteringIterator when toArray was called with $preserveKeys = TRUE. Also converted tests to use data providers.