[js] Add explanations for algorithm
[js] add uiHandlers file + separation of concerns + module pattern + explanations of algorithm displayed