refactoring related to types; also allow field list in groups

interdependent with https://github.com/dimagi/commcare-hq/pull/963

This is ultimately a pretty well-contained change that just refactors a few things.  Tested on a form with all question types, that they get loaded correctly, and that you can change question types and the XML changes accordingly.