Issue 331 optimizing index

See #528 
Some bash scripts handling processing and indexing.