Fix field editing form, move js out of template
Change field type values for compatibility with upstream