Change deprecated $app->getCfg() to $app->get() and a bit CS for /libaries /layouts /templates