[Cookbook][Templating] New way of creating extensions for twig

| Q             | A
| ------------- | ---
| Doc fix?      | yes
| New docs?     | no
| Applies to    | 2.1+
| Fixed tickets | #2421

Added a note refering to old doc and cookbook for previous versions of Twig and tweaked code to add the Twig filter