Javascript: Prototype chain is hooked up