I got the idea for applying abstraction to JavaScript from the C language. Almost all non-trivial C programs will include many separate files, each containing data structure definitions and functions for manipulating those data structures. The actual code is precompiled, so the source code is not viewable. However, each module has a header file, which defines the functions contained in the code, and offers some guidelines for usage.
Using this approach, the only information available to the programmer is what's provided in the header file. While this sounds limiting, it's actually a blessing. Once you know how to make the appropriate function calls, you can use those modules without thinking about the source code. Using a hypothetical example, imagine a header file that defined a function called makeButton() that accepted three arguments - the caption, and the x and y coordinates for where to place the button. Once you knew this, you could easily place buttons all over your application without knowing how the code worked. Unfortunately, C programming is not quite that easy!
Following along these lines, I've started placing generic functions, such as the cookie functions, in separate files. I also create a text file that contains the necessary code to reference the JavaScript file, as well as some comments explaining how to use the module. An example will clarify this somewhat.