make retrieve_rows_sql unconditionally thread-safe - already was in practice, but it would mutate the map if asked for an unknown table.  refactor how we cache those references to allow access to the columns etc, and refactor the row hasher a bit to improve separation.