Simplify mats functions, add support for updating env when code changes via wrap-reload - should be made enviroment-aware before going to prod