Implemented indexes loading/storing
Added some tests for loading/storing indexes