Make JSModule constructor shorter
Make JSModule constructor shorter

By refactoring the part that makes the import path relative into its own
method. The constructor is still complicated, but this at least makes it
a little bit better.

trotzig/import-js,trotzig/import-js,trotzig/import-js,lencioni/import-js,lencioni/import-js,Galooshi/import-js,lencioni/import-js