Refactor/table rendering

Strings manipulation is faster than loads of 'DOM' manipulation on the server. Let's use strings.
Could we possibly do `var body = '';` further up and then ` return '<tbody>' + body + '</tbody>' here? It just makes it easier to keep track of opening and closing tags.