Big overhaul of code. search() now returns an iterator. Updated some method definitions.