Fixed JSON values not working in field options (along with cleaning up how values are stored -- moved to JSON.stringify).
Cleaned up template editing code (removed template image JS, cleaned up some scope issues, reduced DOM lookups.