DRY out use of JSON error return utilities

* Move JSON error return utilites to util.py
* Fix a bug in field/ul.html template
* Fix URL in browseTreesMode.js
inlineEditForm.js no longer requires endpoints to include "ok" or "error" in returned JSON