Merge pull request #781 from mapleoin/attr-accessor

use attr_accessor instead of defining the methods manually
get rid of redefinition of 'initialize'