Bugfix for index updating in TestIndexCSV -- SQL to get max id value was malformed and not executing correctly. Also other bugfixes in indexing code. Adding another test file for testing purposes.