multiple startup/shutdown fixes

* fix autoloading not trying to reload same thing over and over again
* fix the shutdownhook clenaup not to remove() something from the indexes map
  when it is iterating thru it.
* move from timer to periodic (while(1) sleep) thread, makes it easier to read
* remove the index deletion on overwrite, it will just replace things
  in-memory, but it wont delete files (if there are any)