Allow type parameter declaration on object methods

Turns out that we're missing support for things like

  var a = {
    myMethod<T>() {}
  };

This PR adds it in :)