Fix app.js parseMessage and improve compliance with JS style guide

Note the new version of parseMessage returns an array of commands rather
than a single command!