Refactored debug into an options hash for easier option passing in the future + minor edits
refactored to allow options hash to be passed in
refactored for options hash and added functionality for stealth modifier that stops XML from being sent when testing offline but doesn"t affect debug modes