include filtering in to_dict and to_json. resolves #18