Refactor for readability and documentation

Add copyright/license to js file
Rename variables to increase self-documenting value
Increased support for FireFox < 11's lack of outerHTML