-bugfix and enhancement on subtemplate {include} and template {function} tags.

* Calling a template which has a nocache section could fail if it was
called from a cached and a not cached subtemplate.
* Calling the same subtemplate cached and not cached with the
$smarty->merge_compiled_includes enabled could cause problems
* Many smaller related changes