Modularize JavaScript App
Follow the fitting algorithm implementation (!444 (comment 7047612)), one should modularize the app in order to avoid collisions of JS code when files are globally exposed.
Acceptance criteria: modularize JS code. Short-reading on the topic: https://stackoverflow.com/questions/2421911/what-is-the-purpose-of-wrapping-whole-javascript-files-in-anonymous-functions-li/2421949#2421949