Improved pymavlink example test

* Capture stdout
* Global function for calling command line scripts
* pep8 & camelcase