Javascript Single Inheritance Implementation