+htp #15910 import coding infrastructure from spray

Fixes #15910.

This still needs some tests but the implementation is itself is ready to be reviewed.
Love these constants, but what can you do. Should these be pooled later? It seems like we create and throw them away aggressively.