refactored codes to use generic element in tsmart-generic.js so that they are reusable in both group tests and survival analysis acgh