Added string check for output function.  Moved dumps and loads definitions into classes.