How was funding of research done in the medieval universities?
A lot of research during the Middle Ages was funded through the patronage system. Scientist and other scholars would receive financial support from aristocratic families, royalty, and even from clergy. For example, Galileo, out of appreciation of the support of the Medici family, named the moons of Jupiter after several members of the Medici family. Unfortunately, these names did not stick. This is act is similar to a stadium taking the name of a sponsoring business.
Another method of research funding was self-funding. Entrepreneurial scientist would find personal sources of income. Kepler supposedly published horoscopes while Galileo built scientific instruments for income. Scientist who were rich either by birth or through savvy business practice were called "Gentlemen Scientist." Among such gentlemen scientist includes Robert Boyle and Stephen Wolfram