Add documentation and generalize Command class