Test and fix slist passing issues

This superceeds and builds upon @tzz's https://github.com/cfengine/core/pull/588. In looking at it, I discovered a few related issues, fixed some quirks with Ted's testcase, and added an additional one of my own. I ended up squashing my test stuff in with Ted's commit, but I can change that if preferred.

Both tests are fixed by the patch, but there are some related issues to be raised - more tests for those forthcoming.

Addresses [RM #2490](https://cfengine.com/dev/issues/2490)