Added the function "db_search_in_history_db"
Modified a bunch of functions to choose when the history db should be used and when not
Merge branch 'feature/history-db-optimization' into develop