Make the indexing and saving processes very nice, both cpu and io-wise.

Only do it on linux for now, happy to accept tested patches for other OSs.
Update TODO file.