added Smarty template system.
Merge remote-tracking branch 'origin/master'