Js classes and inheritance