Integrated #51 jhaygood86 patch

Integrated jhaygood86's patch for #51 (excluding the log4net stuff).

Commit history is a little messy as I tried to merge in the gist itself, but it wasn't very happy, ended up doing it manually.