Code copied from PGObject::Simple::Role.  Once test cases are passed, will refactor and re-release this module and PGObject::Simple::Role.