Fixed incompatibility with dart 1.0

The dart apis were subject to breaking changes prior to the 1.0 stable release.

This pull request should make the code work with recent dart versions.