standardMethods function

Utility to automatically generate accessor and replacement functions