Use h5d_finalizer to be consistent with other finalizers.
Turned some code from cmd/ in to tests runnable with go test