Add Direction Attribute

* Added dir global attribute and tests