Silence "`*` interpreted as argument prefix" warnings
Don't use deprecated form of attr

The form "attr :name, true" is deprecated and causes Ruby to emit a
warning in verbose mode. Using attr_{reader,writer,accessor} is more
clear anyway, so do so.
Remove unused variables
Don't shadow outer local variables
Silence warning about unescaped square brackets