Prepare #717. Cookie injection and head injection share the same logic.
Implements user interface for #717
Add missing components #717
Implements #717
Fix #717 cache issue
Merge pull request #772 from emmanuel-keller/1.6

Implements #717