OO based programming in Javascript