Simplified QueryTest
Added IndexTest
Tidied QueryTest and added IndexTest
Tidied IndexTest