fix memory leak
Fix JavaScript module and libraries.
Merge pull request #392 from tetsurom/ClassFix

fix memory leak
Merge pull request #393 from tetsurom/JSFixPR

Fix JavaScript module and libraries.
remove unused code
remove compiler warnings