Fixed the test failures on phantomjs and added a configuration option to let the user choose between getting an attachment as text or as a Blob, defaulting to text.