Lots of refactoring again, added the first part of a separate command bar module.