Optionally generate plain javascript modules

Fixes #1