Move config HTML generation to separate helper function.
Add test for itemtype.