JavaScript module definition pattern