A JavaScript inheritance pattern