Feature server-side scripted terms

Addresses  #826 and lays the foundation to close #971.
Assuming the implementation is generally acceptable, I'll do the small amount of work to close #971.