javascript module definition snippet