Upgrade to Smarty 3.1.18

Includes optimizations and security improvements since the original 2011
commit. 3.1.18 was published 4/4/2014