Fixed generation of demo JS and CSS

Some of the previous changes were inadvertently reverted so restoring those changes.