cleanup twig extension parser and fix function caching
refactoring of twig function parser to use regular expression and pipe type signature to later usage, also allow more navigation on more use cases