JS refactoring:
1. Make modules less related to each other. Remove unnecessary global vars
2. Make [dom] module cache selecting results in vars;