Tiered sorting for case properties

Implements the tiered sorting spec for apps 2.2 and up. See: http://manage.dimagi.com/default.asp?44102

The new stuff was done in knockout even though the existing code is not. It's the first knockout code I've ever written...

Still pending UX test round so don't merge yet, just hoping to get feedback first.

![screen shot 2013-07-12 at 2 42 13 pm](https://f.cloud.github.com/assets/152134/790248/d1641edc-eb22-11e2-8564-138fc7e64fb9.png)