Adding function to extract messages from soy templates