RefLog implementation

This is lingering around locally. Let's get it in GH at least...