Make more changes to the Loader API. Add Ref<?> support.