added new test cases, cleaned js files