Use tables to deal with huge responses.

Instead of accumulating the response in a string, use a table. This reduces the chances of "out of memory" errors when testing endpoints that produces huge amounts of data.

It also changes the call to `common.send_content` to match the way it is used in wsapi itself.