Issue #2854444 by pivica, Berdir, markcarver, toncic, miro_dietiker: Refactor field widget code to reduce duplication and make theme abstract