[JS] Change the OO model in order to provide a superclass

Some tests are currently broken
[JS] Fix type checker issue