Clean error popup when launching on a non-directory from command-line

We previously did the sanity check from Java, and only displayed a
message on System.out in case of failure. Move the check to JavaScript,
and show a popup in case of error.
JSon syntax errors in an alert() popup, not on the terminal.

The syntax error is rarely accurate, but direct the user to
http://jsonlint.com/ for good error checking. We may want to add the JSon
error diagnosis to Dahu itself (e.g. https://github.com/zaach/jsonlint),
but that would add one more dependency...