Fix bug when reloading the database

Now instance maps are correctly reset when file is rescanned (but this should not happen in the final product)
Add resetDatabase method

resetDatabase() will delete all instances in the database.
This would make LogicTest easier