Added Smarty 3 compatibility

Hi,

I've modified the smarty task to be smarty 3 compatible. It uses the smarty compatibility layer for that, and may fail if that layer is removed in the future.

In a second commit, I've just removed some trailing whitespace.