Clone of twig-persist version 2 from google code (https://code.google.com/p/twig-persist/)