Use reflection to avoid awkward getDirectory()

Reflection can provide the directory that the concrete child class of an
abstract class is defined in.