the royal library had started as a massive natural cavern , but a hundred years of careful work by skilled masons had transformed it into a series of long open halls filled with tall pillars and intricately carved domed ceilings .