+htp #15910 import coding infrastructure from spray

Fixes #15910.

This still needs some tests but the implementation is itself is ready to be reviewed.
Basically, I don't know where to look for stuff in streams. If it's not in the API / DSL I probably won't find it. So, I went with the simplest solution I could find. Will change.