Fixed memory leak issue, added memtest.js