Heavy modifications based on the smarty internal include function (due to variable names were not resolving and the fact that they're not even supposed to be resolved at compile time)