delete nil or empty arrays. fixes issue of improperly cleared dictionaries. added explicit clear method.

set dictionaries. added an explicit clear function