Add factory and basic tests for workflow and subject group