changing split string by to use imperative loop since it will be faster than precalculating a string to a list.

I ran it against a 6MB file containing 45,000 lines and it took 1 second, whereas the original functional way never even finished!
adding more tests