moved search result JS out of Mako template
improve Editor field cloning and validation