Fix Javascript classes dependency tree