Major cleanup

Trimmed, cleaned up and polished the index file. Also reorganised the
file structure.