How to install a Twig extension
The BreakAndContinue plugin is an example of a plugin that adds a simple twig extension. I would start with that, and modify it to add the extensions extension (I assume that is this: https://github.com/twigphp/Twig-extensions ?) You might need to tweak the Twig PHP to get files to load etc., but not core Craft, since this will be a plugin.