New commands run, define, remove, other miscellaneous improvements

Continued re-implementation of cf-sketch interactive commands, plus some code reorganization, new utility functions and other internal improvements.