Adding tests for deleting and creating branches

Also refactored some logic out of the models that belonged to the commands class.