remove html output from rest
Close context at end of REST request to community

- Following advice from Richard Rodgers at OR14
DS-1986 Get new context each time, close in finally, for all REST methods
Merge pull request #567 from peterdietz/rest4x

(For 4.x branch) DS-1986 REST to use new context for each request