CRM-14822 add checkbox handling to api custom fields

This fixes several logged issues as well as ongoing customer & forum complaints to do with the api not handling checkboxes correctly - the new code is only called for custom fields of type CheckBox - no other flows are touched & all the possible formats for checkboxes (ie. the one that already worked & the api-consistent ones) are heavily tested in the new tests (as well as pre-existing ones)

if ($checkCheckBoxField && $fields['custom_' . $customFieldID]['html_type'] == 'CheckBox') {
// Does this work as a comma-separated list?
// Check this last (after all other possibilities) because comma-separated format may be ambiguous
// for some fields/option-values.