Added check to make sure switchboard payload is a string before parsing. Refactored switchboard to have an event listener API to make it easier to test the switchboard.