Refactors db_history_spec and adds test for next_id method of DBHistory.next_id
Adds next_id method to DBHistory