Added some tests and partially implement addCommand