Completed code to generate id dictionaries and master prevtext, firstcol, and firstrow lists. Output should be ready for input into database buildout code