Use attr_accessor and attr_reader rather than undocumented attr; Fixes #6.