Don't delete checked in files with 'make distclean'

Occurs when ruby is not detected.
Fixes #290.
Tidy up Javascript build system