Updated smarty to 3.1.16
refactored custom smarty code
updated readme