Improve cli backtrace. closes #1634

rewrite due to coding standard violations and lack of response from the
PR author. also added missing new config key