Fixes for email, improved assoc_arrays in DB, and added funcs to Drupal plugin