Javascript native object inheritance implementation