client-side JavaScript module implementation