Smarty 3 support added to Smarty mode

Hi Marijn,

This pull request updates the Smarty mode for Smarty 3. For backward compatibility, I've left the default Smarty version to be 2, but people can enable it by adding a "smartyVersion" config option, set to 3. Otherwise, the mode should work exactly as before (despite the refactor).

I've put up a demo here, that highlights the new features supported by Smarty 3, including nested functions, permissible standalone curly braces and other stuff:
http://www.benjaminkeen.com/experiments/CodeMirror/mode/smarty/

Let me know if you'd like me to change anything. Thanks!

Ben