Added functions for the cleaning of substrings:
clean_substring and self() and self_parent() for deriving class's name and
parent name so different classes can be called for substring sanitation