Bring commandFactory and test to AngularJS