Shaping up the indexer class API. Extracting main() method to a testing class. Refactoring for better object orientation.