more cleanup in the replace_loc functions
changed from conn to cursor, because execute is a cursor method
more cleanup
renamed attached loctbl db as loctbl to disambiguate from a built loc table