Remove ingest from main.cpp and put it in separate file