Use __DIR__ directly, instead of storing it in a variable.

I had switched to using $dir = __DIR__ and then using $dir each
time I needed the directory. I've been told this is less efficient
and that __DIR__ should be used, so I'm changing it back.

Change-Id: I958adb52ab4d0056c8c2dbe24d289d451141dd94