function applyStates (elementKey, baseClass, globals, context) {
  return Object.keys(states).reduce((classes, stateKey) => {
    // Step 1. Call the state function to determine if it has this state
    if (states[stateKey](context)) {
      const key = `${elementKey}${cap(stateKey)}`
      const propKey = `${key}Class`
      // Step 2. Apply any global state class keys
      if (globals[key]) {
        const modifier = (typeof globals[key] === 'string') ? arrayify(globals[key]) : globals[key]
        classes = applyClasses(classes, modifier, context)
      }
      // Step 3. Apply any prop state class keys
      if (context[propKey]) {
        const modifier = (typeof context[propKey] === 'string') ? arrayify(context[propKey]) : context[`${key}Class`]
        classes = applyClasses(classes, modifier, context)
      }
    }
    return classes
  }, baseClass)
}
Given element class key
@param {string} elementKey the element class key we're generating for
@param {mixed} baseClass The initial classes for this key
@param {object} global Class definitions globally registered with options.classes
@param {Object} context Class context for this particular field, props included.