Updated code to match the M2 changes.

Minor changes to how JSON is parsed, parseInt renamed to int.parse
and Timer moved to the new dart:async package.