Using constant methods

Generating constant methods instead of accessors and updated chmod part
in tests to run on Mac as well.