CRM-13149 add relationship type filter to relationship api (both paths)

includes Refactor api array-style filter into CRM_Core_DAO to allow it to be used in sql generation too.