Private function that generates a model.require function based on the libraries that have been imported in this session.