Class-like inheritance for javascript