View http://css-tricks.com/how-do-you-structure-javascript-the-module-pattern-edition/
When I first saw something that looked like the pattern outlined in this article it felt like complete magic. As patterns become more abstracted they look to be more magical, but in a great way. Following conventions like these definitely makes for more portable, reusable, understandable, testable code.
Chris does a fantastic job walking us through the Module Pattern, worth a read if it’s something you haven’t explored too much yet.