Minor reformatting.
Serious code cleanup and prevent IE8 from falsely failing some tests.
Convert to UMD