Define common variables in separate function.

New common variables:
    * template_path,
    * template_abs_path,
    * template_dir,
    * template_abs_dir,
New directory: examples
New example listed in README.md