Support generating JavaScript output into custom directory.

Add new project option for defining the output directory for the
generated JavaScript files.