Templating script that supports multiple input types, nesting, and order insensitive php calls.