WIP refactoring index.js
Non-dev mode for fast page loads