Minor refactoring
Add command to dump joule descriptor in mat format
Externalize code reading from serial interface and properly handle stop events