Added more type annotations to runtime.

Unfortunately, it doesn't compile; I can't explicitly cast ClassData to
ReferenceClassData. Hm.