[Scripts] Cleanup of scriptloader and declarations