Improved the way forward index stores terms.

Improvements:
- Terms file is written in large blocks now, speeding up saving and
loading
- Inverse sort order is also stored, so it doesn't have to be generated
while opening the forward index, saving more time
- Case-insensitive sort order is also stored, so the forward index can
be used for case-insensitive sorting/grouping as well.
Sped up reading/writing ContentStore table of contents.

Instead of writing int array with separate method calls, wrote the array
as one block.
Fixed Hits.totalNumberOfHits not getting set in some cases