Move some common Twig macros from WebBundle to ResourceBundle.

Fixes #1841.