Code enhancement on js. Fixes #32
Code enhancement on file dialog. Fixes #33