Fixes #2. Added separated sections db calls into a separate js module.
Fixes #2. Restructured and refactored the code to better fit and MVC structure.