Fix class inheritance reflection to JavaScript. Add test for inheritance.