Add Refs API.

@christophercurrie
Ah, ok, sounds good.