[api] move even more duplicated relationships code into the mixin
[dist] the author pulled safe_yaml 0.9.4 from rubygems

so to continue using travis, we need to rely on 0.9.5, I already
complained at https://github.com/dtao/safe_yaml/issues/43