When writing a new JS lib or embeddable file, I use this structure to avoid cluttering the global namespace.
I am defining an object and placing the functions inside the object. This is nothing new or unheard of, just my way of doing it.
Notice I placed all the variables into their own sub-object, this is done to ease development.