Defined a dirname constant
Defined a plugin dirpath constant
Removed some mis-placed requires