Improves loading of libraries in discovery/JS and adds missing files