made resource subclasses friends of resource to facilitate modification of protected/private members outside of 'this' context in factory creation and cloning methods. Re-ordered implementation and header methods to be consistent.