Fix syntax in bugreport
Refactor tables.js