Modules and snippets in pure JavaScript