Fix bug: edit task did not create the appropriate task type

Fixed a bug where editing a task did not create the appropriate task
type object.
For example “timedtask” should new TimedTask() but instead it was doing
new Task().

This fix also fixes the edit timed task for Google Integration, and
avoid a classcastexception at both Google Integration and LocalStorage.