get rid of global $modx
Merge pull request #166 from Pathologic/master

get rid of global $modx