How to put a comma between city and state in addressfield display?
This is actually pretty simple, once you know the hooks and have some example code. You're correct that you need to use the ctools plugin api. So in a custom module, add:

/**
 * Implements hook_ctools_plugin_directory().
 */
function mymodule_ctools_plugin_directory($module, $plugin) {
  if ($module == 'addressfield') {
    return 'plugins/addressfield/' . $plugin;
  }
}


Then you drop plugin files in the directory you specified, within your custom module. In this case, plugins/addressfield. A file that will do what you're looking for would contain something like this:

&lt;?php
/**
 * @file
 * city-comma.inc
 *
 * Adding comma after city.
 */

/**
 * Plugin definition for address field format.
 */
$plugin = array(
  'title' =&gt; t('Comma after city.'),
  'format callback' =&gt; 'mymodule_city_comma',
  'type' =&gt; 'address',
  'weight' =&gt; -80,
);

/**
 * Callback for plugin definition.
 */
function mymodule_city_comma(&amp;$format, $address, $context = array()) {
  if (in_array($address['country'], array('US', 'CA'))) {
    if ($context['mode'] == 'render') {
      // Add comma after city.
      $format['locality_block']['locality']['#suffix'] = ',';
    }
  }
}


This file would actually go in a directory called 'formats' inside the directory defined in the hook. So: mymodule/plugins/formats/city-comma.inc.