Implement command dispatch.