put all together
force  windows.dispose for shutdown
move code to JS code modules
move windows initialization to modules