Simple JavaScript Class pattern