fixes #240: treat unrecognised extensions as JS; support JSON

Fixes #240.