Enhancement of external programs management

* Added class for management of external programs
* Cleaned code