centralized smarty instatiation and config
moved SQL connection config to config.php
added install script
fixed install script and silenced some warnings