Refactored all command code to provide a simpler and more cohesive way of adding commands to widgets.