Refactor and fix case property naming

Fixes the bug where even unnamed case properties were being saved to
cases

http://manage.dimagi.com/default.asp?91364#521915