js: Refactor library.
js: Refactor library.

  * Refactor js library to use deferrend and external functions.
  * Use also batch API.

Change-Id: Ic5ec68e42d7b0c47b4b0801478ecee09992e1e0c

kernelci/kernelci-frontend,kernelci/kernelci-frontend,kernelci/kernelci-frontend,kernelci/kernelci-frontend