Major performance boost for form properties

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

Memoizing the apps-in-domain lookup gave a modest improvement, somewhere around a few seconds (not much compared to the speedup below).