Refactor out some repeat code in widget serialization and improve widget type entry