+htp #15910 import coding infrastructure from spray

Fixes #15910.

This still needs some tests but the implementation is itself is ready to be reviewed.
it's normally good to do a `system.awaitTermination(10.seconds)` also