Add javascript equivalent of ruby classes - constructor functions