Wrapped in an IIFE to avoid global polution, added to window as window.Instance
Moved var declarations to top of functions, avoids hoisting issues'
Made the indentation consistent
Added JSdoc block for each function
Merge pull request #2 from ilikeprograms/master

Mostly formatting/doc changes