Added factor table support to Javascript API and add Java doc throughout