Updated to generate output as we expect.

  This involved changing period handling and regarding ".js" as
 special.

  See #1 for details