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 #771 from emmanuel-keller/1.5

Implements #717