Better cross-browser support

Adds better cross-browser support, it now uses MutationObservers only on
IE11.
some basic code format changes