Class-like Javascript inheritance