Added method to get locations count by type

Also, splitted core changes from PR: https://github.com/dimagi/commcare-hq/pull/3839
Would it be safer/more defensive to say this:
```js
this.selected_path().length < this.location_types.length
```
Maybe I'm not understanding fully though? Is there a case where the selected path length would be greater than the number of location types?