Tweaked the Plugin loader to do the same but with less code.
Merge pull request #1 from freshteapot/master

Plugin loader tweaked to use less code.