Implement batching INSERTs to speed up syncing
This consists mainly of following parts:
- Creating an
Inserterabstraction and using it for inserting data into the DB - Simplifying block processing logic and unifying normal operation and testing
- Logic for switching between batch and single block commits