made enums bit flags. updated test app to include secret. updated simulator to send back messages on errors.