Refactoring run_mgtool and related code...
Changing database configuration to be defined as objects of a class.