CRM-14478 - Add generic API, "getrefcount"

For example: Before deciding whether to delete RelationshipType 123, we can see how many usages there are by calling:

```php
$result = civicrm_api3('RelationshipType', 'getrefcount', array(
  'id' => 123,
));
```

Internally, this borrows from / refactors the pre-existing CRM_Core_DAO::findReferences() and introduces a sibling function, CRM_Core_DAO::getReferenceCount(). As before, this counts references in standard SQL FK's and dynamic SQL FK's. It adds support for option-value FK's like "civicrm_activity.activity_type_id".

FIXME: It does not yet count references stored in CiviCase XML.