Add attribute style access for variables and attributes

Fixes #286