fix insert-new-cell button

was broken by late loading of command prompt
took the opportunity to move code in there
fixes #950