Simplify and clean up attribute getters and setters in Element.lua