Adds optional table ID argument

tableToJSON now takes an optional 3rd argument, tableID, which allows
the user to specify a table by ID.