create modes file to store mode value and include on all pages. refactor config to ensure only relevant libs and modules are loaded when required rather than on app init