CRM-13092
CRM_12639_fix : sending a clean PR after https://github.com/civicrm/civicrm-core/pull/1272 produced merge conflict
CRM-12639 : improvement as per https://github.com/civicrm/civicrm-core/pull/1272#issuecomment-21735152 comment , but couldn't find a way to retreive pseudo constants labels for email_greeting, postal_greeting, addressee, state_province_abbreavation , so left the condition statements as it is.
fixed query for CRM-13147
Merge pull request #1303 from yashodha/CRM-13147

fixed query for CRM-13147
Merge pull request #1284 from yashodha/4.4.CRM-13092

CRM-13092
Merge pull request #1290 from pratik-joshi/CRM_12639-fix

Crm 12639 fix