added dict flattener and cleaned up test code