Refactoring: add IoC, separate jQuery and other browser-specific functionality into separate modules