Allow .js at the end of module names

Issue #1221
I guess the last case will become the common case, perhaps you want it first.