Researchers have published historic Scottish government records online for the first time after a four-year long project.