Refactor commands, extract active record datastore, extract commit processor