Baptism as a pledge of allegiance
Baptism is (among other things) a public renouncement of one’s former enslavement to Satan and the other spiritual rulers of this present darkness, and a vow of fealty to the enthroned king, Jesus.
Does James teach justification by works?
Yes—inasmuch as works are a proper part of the living faith by which we dwell in Jesus, and he in us.