Major performance boost for form properties

http://manage.dimagi.com/default.asp?146259

Another suggested improvement that I did not do because I couldn't verify if it was logically correct is to pass `include_shared_properties=False` to `get_properties_recursive` above ([line 126](https://github.com/dimagi/commcare-hq/pull/4831/files#diff-8a78f7edae07ff768accdb85fbaace47R126)). This would eliminate some seemingly redundant calls to the global `get_case_properties` ([line 144 below](https://github.com/dimagi/commcare-hq/pull/4831/files#diff-8a78f7edae07ff768accdb85fbaace47R144)).