Fixes line truncation in insert_lines statements at 4k

This includes a few fixes for insert_lines promises, where the lines get truncated at 4k. I've also included a basic acceptance test.

This change also includes a fix for SplitString, as it's used in one of the insertion functions. There's more to come for this file, but since it was brought up in help-cfengine, I think it's worth submitting as-is right now for review and possible inclusion.
This is still an issue I think. If the string starts with separator, the ```sp[-1]``` will access out of bounds.