Update PlugXDecode.py

Cleaned up code, added script exit on missing dependencies, and implemented logging factory.