This snippet illustrates how you can allow your users to put your library into whatever global they see fit.
This technique currently relies on your script tag being the last on the page at time of execution. This means that it will not probably not play nicely with async or defer