refactor; and add completexContext/failedContext/ContextMessage handlers

use Java `enum` for this functionality (including `nHandlers` and the map below)