added tests, finished aho_next() interface; various little improvements