Fix name conflicts for tables and formset tables

Since the javascript for the formset data table uses the table's ID to
find all the HTML elements, an existing data table with the same ID on
the same page will also be affected.  This patch makes sure that the
tables have different names than the formset tables, so that they will
also have different IDs. Note, that it's also invalid HTML to have two
elements with the same ID.

Also, I fix a badly named variable that must have been copy-pasted.

Change-Id: I533d6ac570ad1db380529a79a6e254b78f682271