Calculate loan in js (browser/node.js) for equal installments, installments decreasing, the sum of interest, etc.