Updated plan to use an instruction mapping instead of an if statement

This is the next step in #997 

cc @asmeurer @ilanschnell 
Use str(e) here instead of e.message as the message attribute is removed in Python3.  This is causing the failing Python 3 tests on Travis-CI presently.