Fixed problems with chain. Using issubclass instead of __name__ != category.
Fixed problems with chain and with tagged_words substituting all_words.
Fix typo.
Added docstring and check for lists and tuples in ilen.