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 #773 from emmanuel-keller/master

Implements #717