Fix invalid call context in IE

The element collection is invalidated once it is added to the div item, so
make the call to getElementsByTag *after* the content is added to the div.

Signed-off-by: jketreno <james.p.ketrenos@intel.com>
Merge pull request #57 from jketreno/master

Fix invalid call context in IE
Make all console.log calls conditional on debug flag

These can cause errors in older versions of IE.
Remove trailing slashes after last object property

These can break pages on older versions of IE.
Don't append script elements then execute them

Rather than appending new content then executing the content
of its <script> elements (which could potentially cause problems),
strip the <script> elements out of the content first, append
the content, then execute the scripts.
Merge pull request #58 from townxelliot/ie-fixes

Fixes for Internet Explorer 9