@safe, pure, nothrow and homebrew ref.counting

The entire module has been marked with the appropriate function
attributes.   In doing so, I ended up replacing std.typecons.RefCounted
with a simpler home-made type.