Started adding tests

Started adding JUnit tests and addressing any small bugs found in
Indexer.