Fix bug with handling finished indication (introduced by switch to fgets)
Some coherence fixes

- Properly set core ID parameter
- Check core ID when processing cache fills
- Cleanup: use a new type cache_line_index_t to refer to a memory address
that is a multiple of the cache size.
Rearrange defines a bit