Added a way to properly load resources in Smarty, closes #1431.