Outsource stream splitting
Make split_str almost work
Finish split_str
Add first parameter as well