[javascript mode] Improve number tokenizing

A leading minus isn't part of the number token, but numbers can
start with a dot, which wasn't handled before.

Closes #1753