Refactors tests, and moves index file