Refactor relationship matchers

Based on the code from https://github.com/philandstuff/rspec-puppet/commit/ac7839d

Thanks @philandstuff!