Changed retrieveDirectSubTemplate from private to public; Added function getBehaviorByType to get the behavior attribute of a widget by the nth occurence of a certain type (e.g. InputField) in a specified context recursively.