Merge pull request #117 from BlackHC/fixes

Update forwarder and fix other warnings throughout the library
diff --git a/lib/html.dart b/lib/html.dart
index 56ce288..794cdf9 100644
--- a/lib/html.dart
+++ b/lib/html.dart
@@ -15,7 +15,7 @@
 library webdriver.html;
 
 import 'dart:async' show Future;
-import 'dart:convert' show JSON, UTF8;
+import 'dart:convert' show JSON;
 import 'dart:html' show HttpRequest, ProgressEvent;
 
 import 'package:webdriver/support/async.dart' show Lock;
diff --git a/lib/support/forwarder.dart b/lib/support/forwarder.dart
index 324fd9c..2963f6e 100644
--- a/lib/support/forwarder.dart
+++ b/lib/support/forwarder.dart
@@ -14,13 +14,13 @@
 
 library webdriver.support.forwarder;
 
-import 'dart:async' show Future, StreamConsumer;
+import 'dart:async' show Future;
 import 'dart:convert' show JSON, UTF8;
 import 'dart:io' show ContentType, Directory, File, HttpRequest, HttpStatus;
 
 import 'package:path/path.dart' as path;
 import 'package:webdriver/core.dart'
-    show By, WebDriver, WebDriverException, WebElement;
+    show By, WebDriver, WebDriverException;
 
 final _contentTypeJson =
     new ContentType('application', 'json', charset: 'utf-8');
@@ -133,8 +133,8 @@
         if (method == 'POST') {
           // take a screenshot and save to file system
           var file =
-              new File(path.join(outputDir.path, params['file'])).openWrite();
-          await driver.captureScreenshot().map((b) => [b]).pipe(file);
+              new File(path.join(outputDir.path, params['file']));
+          await file.writeAsBytes(await driver.captureScreenshotAsList());
           return null;
         }
         break;
diff --git a/test/io_config.dart b/test/io_config.dart
index 596d75b..fc85342 100644
--- a/test/io_config.dart
+++ b/test/io_config.dart
@@ -17,7 +17,7 @@
 import 'dart:io' show FileSystemEntity, Platform;
 
 import 'package:path/path.dart' as path;
-import 'package:webdriver/io.dart' show WebDriver, Capabilities, createDriver;
+import 'package:webdriver/io.dart' show Capabilities, createDriver;
 
 import 'test_util.dart' as test_util;